I am getting following error while creating a new topic using RESTful
design. But, everything works fine when I use <% form_tag :action =>
:create do %> .
ActionView::TemplateError (undefined method `symbol_path’ for
#ActionView::Base:0xb72a2e40) on line #3 of topics/new.rhtml:
1:
New Topic
2:
3: <% form_tag :topic, :url => topics_path do %>
4: <%= render :partial => ‘topic_form’, :object => @topic %>
5: <%= check_box_tag :make_standard, :true, @standard%>
6: Fill with standard items
Any clues?
CS.
Please someone help me with this… My previous posts have also received
no response.
I am getting following error while creating a new topic using RESTful
design. But, everything works fine when I use <% form_tag :action =>
:create do %> .
ActionView::TemplateError (undefined method `symbol_path’ for
#ActionView::Base:0xb72a2e40) on line #3 of topics/new.rhtml:
1:
New Topic
2:
3: <% form_tag :topic, :url => topics_path do %>
form_tag doesn’t work like that - the first argument has to be a hash
of routing options or a path. Looks like you were actually trying to
use form_for (or you just wanted form_tag topics_path)
Your suggestion worked for creating topic. However, I have nested
resource as topic has_many items. When I use similar form_tag method in
my items, I am getting " undefined local variable or method `items_path’
for #ActionView::Base:0xb71c205c" error.
Please see: Undefined variable or method in form_tag url - Rails - Ruby-Forum
I tried it with <% form_tag items_path do %>.
Also if someone could help me in my self-referential associations and
REST topic that would be of really great help.
I am getting following error while creating a new topic using RESTful
design. But, everything works fine when I use <% form_tag :action =>
:create do %> .
ActionView::TemplateError (undefined method `symbol_path’ for
#ActionView::Base:0xb72a2e40) on line #3 of topics/new.rhtml:
1:
New Topic
2:
3: <% form_tag :topic, :url => topics_path do %>
form_tag doesn’t work like that - the first argument has to be a hash
of routing options or a path. Looks like you were actually trying to
use form_for (or you just wanted form_tag topics_path)
I referred tohttp://ueckerman.net/2007/04/24/the-basics-of-rest-in-rails/.
Your suggestion worked for creating topic. However, I have nested
resource as topic has_many items. When I use similar form_tag method in
my items, I am getting " undefined local variable or method `items_path’
for #ActionView::Base:0xb71c205c" error.
that just sounds like your routes.rb is not in sync with what you’re
trying to do (since it’s from there that the helper methods items_path
and so on are created). You might find
I referred tohttp://ueckerman.net/2007/04/24/the-basics-of-rest-in-rails/.
Your suggestion worked for creating topic. However, I have nested
resource as topic has_many items. When I use similar form_tag method in
my items, I am getting " undefined local variable or method `items_path’
for #ActionView::Base:0xb71c205c" error.
that just sounds like your routes.rb is not in sync with what you’re
trying to do (since it’s from there that the helper methods items_path
and so on are created). You might find Rails Routing from the Outside In — Ruby on Rails Guides
useful
Fred
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.