Undefined method `symbol_path'


#1

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. :frowning:


#2

On Mar 9, 12:17 am, Carlos S. removed_email_address@domain.invalid
wrote:

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)

Fred


#3

Thanks Fred…

I referred to
http://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.
Please see: http://www.ruby-forum.com/topic/180779
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.

Thanks,
CS.

Frederick C. wrote:

On Mar 9, 12:17�am, Carlos S. removed_email_address@domain.invalid
wrote:

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)

Fred


#4

On Mar 9, 1:24 am, Carlos S. removed_email_address@domain.invalid
wrote:

Thanks Fred…

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
http://guides.rubyonrails.org/routing.html
useful

Fred


#5

Figured it out…
It is just <%= agenda_item_url() do %>

However, I am not able to pass agenda_id and item_id to this create
method in my controller.

Frederick C. wrote:

On Mar 9, 1:24�am, Carlos S. removed_email_address@domain.invalid
wrote:

Thanks Fred…

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
http://guides.rubyonrails.org/routing.html
useful

Fred