Cisco Ri wrote:
>
> Right now my controller looks like:
>
> <% form_for @link, :method => :get do |f| %>
1) Controller? Isn't that a View?
2) Looking at an example in my book for form_for shows that the first
argument for form_for is a Symbol, e.g. :link.
3) You didn't specify the action(a method in the controller) that you
want the form data to get sent to, for instance:
<% form_for :link,
:url => {:action => :new} ....... %>
Since a rails url is of the form:
host/controller/action
and your url is:
http://localhost:3000/links/new?url=http://www.google.com
you are trying to call an action(or method) named new that is defined in
the links controller. That is why I specified :new for the action.
4) My book shows specifying the :method a different way:
<% form_for :link,
:url => {:action => new},
:html => {:method => :get} ....... %>
5) Did you define a method called new in the controller whose view this
is?
I don't know if some of those changes are because I'm using rails 2.3.2
and you are using a 1.x version or not. I would guess that it's
mandatory to state what version of rails you are using when you post a
rails question.
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---