Tag Archives: ror

Using form_tag and collection_select with Rails3

After being away from rails for a while, i’m coming back en version 3 to check it all out again.

I had a problem with how to create a simple select, using the FormHelper.

I had two models, a user and a customer. They are defined as follows:

class User < ActiveRecord::Base
  belongs_to :customer
end
class Customer < ActiveRecord::Base
  has_many :users
end
Tagged , | Comments Off

Using link_to in rails with :confirm and :method

Every time i’m going to use the link_to method in rails, I always seem to get a lot of errors. The documentation states: link_to(name, options = {}, html_options = nil) link_to(options = {}, html_options = nil) do # name end …

Tagged , , , | Comments Off

Use Rails’ form_tag with care

Today at work I was fiddling with some forms in an admin interface. When I had to make an update form, the data didn’t hit the correct controller action.

If you ever get the message ActionController::MethodNotAllowed, then you’ve created your form wrong!

Tagged , , | Comments Off