I'm trying to implement single-column regionalization for a Rails application and I'm running into some major headaches with a complex SQL need. For this system, a region can be represented by a country code (e.g. us) a continent code that is uppercase (e.g. NA) or it can be NULL indicating the "default" information. I need to group thes...
I am trying send user profile images from a client to the server using ActiveResource. It looks like ActiveResource doesn't support multi-part.
Is there a gem/plugin that adds Multipart support to ActiveResource?
Or any other alternative approach to addressing this issue.
...
I have the following table in a form that's embedded in a formtastic form (semantic_form_for). Everything I ask to be generated by ruby shows up, but the table gets badly mangled (essentially, the tags NEVER get formed.
The table headers get drawn correctly
There are 14 available_date objects that get passed, and they alternate betwe...
On my dev setup, generated routes are mysteriously pointing to my public www server.
<%= javascript_include_tag :defaults %>
[yields]
<script src="http://www.mysite.com//javascripts/prototype.js?1265304231" type="text/javascript"></script>
<script src="http://www.mysite.com//javascripts/effects.js?1265304231" type="text/javascript"><...
I would like to return the id of a newly created object for my ajax call instead of returning the view associated with the controller method.
...
I am working on photo sharing web site and i want to add functionality which can create my application's whole gallery in to the face book gallaries . Is ther any code whch can be added to do such things .
Please help me out . IF find any link, kindly share in the answer , i hope i am clear anough ?
...
Hello,
I have added auhlogic in my Rails app to authenticate users. I have also included the code from the Reset password tutorial . All of it works, the only issue I have is that once a user registers he gets automatically logged in.
Anyone worked with authlogic, what would be the best & fastest way to disable the autologin after the...
When creating a new Rails project using:
rails sample
Then creating a model using:
script/generate model person first_name:string last_name:string
Everything is fine. However, if I add any gems to my environment.rb:
config.gem "authlogic"
And run the same generator, I get the following:
/Library/Ruby/Gems/1.8/gems/rails-2.3....
Ruby on Rails is maybe the most praised web development framework exist. There are tons of reasons for that, but every framework, even the best of its kind, has its drawbacks.
I'd like to know the most common problems you run into when developing Ruby on Rails applications and the issues you often struggle with.
...
Hi all.
Imagine a simple model.
class Service
belongs_to :user
validates_associated :user
accepts_nested_attributes_for :user
end
Nothing special right?
The validations on the associated User model trigger correctly in development mode. But don't do anything in production. I've added a validates_on_presence :user just like the d...
In my app, a user can run a script, and if it is run in the terminal, it shows a nice progress bar, how would I replicate this in rails? I mean I could do like something between the two to communicate, but I would prefer if it would just show a "live" shell output.
Thanks :)
...
c:/ruby/lib/ruby/gems/1.8/gems/mechanize-1.0.0/lib/mechanize.rb:259:in `get': 500 => Net::HTTPInternalServerError (Mechanize::ResponseCodeError)
I get the above error when I try to navigate to the following webpage
http://fakewebsite.com//admin/edit_building.cfm?page=buildings&updateMode=yes&id=1251
I can navigate just fine ...
Rails has the rest autho plugin which works well but is there a solution for incorporating twitter, facebook, google, yahoo, etc...
Seems like each on has its own plugin and demands and mixing them is going to be a mess.
This is for logging in users like how Stackoverflow gets things done not for using the robust features of the APIs.
...
I'm using mechanize to login into a website and then retrieve a page. I'm running into some problems and I suspect this is due to some values in the cookies. When Mechanize logs into a website I assume it stores the cookies.
How do I print out all the data stored in the cookies by Mechanize?
...
I'm trying to set up a date of birth helper in my Rails app (2.3.5). At present it is like so.
<%= f.date_select :date_of_birth, :start_year => Time.now.year - 110, :end_year => Time.now.year %>
This generates a perfectly functional set of date fields that work just fine but....
They default to today's date which is not ideal for a d...
Hy!
In my app, every profile has a gallery and this gallery has images. They can have 1 or 1000 images, so when i show up the gallery i only need a part of the images, let's say 12 images. Then in my ajax gallery when, someone requests more images are loaded.
This gallery is SEO, so, the main url is: "/profile-url/" and then, there are...
I have been trying for some time to serve & cache static files for my rails app using nginx. the rails app server runs mongrel_cluster and is deployed on a different host than that of nginx.
following many of the available discussions I tried the following
server {
listen 80;
server_name www.myappserver.com;
...
I have this code:
<%= f.text_field :email, :type => "email", :placeholder => "[email protected]" %>
So people can enter their email on an iPhone with the email keyboard instead of the ASCII keyboard. However, the output is:
<input id="user_email" name="user[email]" placeholder="[email protected]" size="30" type="text" />
which should...
If I have a block of code like this:
def show
@post = Post.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.xml { render :xml => @post }
end
end
How do I add something like
format.json
Any tips, pointers, ideas gladly welcomed...
...
Hi,
I am working with the following piece;
def index
@user = User.find(params[:id])
rescue
flash[:notice] = "ERROR"
redirect_to(:action => 'index')
else
flash[:notice] = "OK"
redirect_to(:action => 'index')
end
Now I either case whether I have a correct ID or not, I am always getting "OK" in my view, what am I...