# Undefined method \`symbol\_path'

**URL:** <https://www.ruby-forum.com/t/undefined-method-symbol-path/162344>\
**Category:** Rails\
**Created:** [March 9, 2009, 1:17am UTC](https://www.ruby-forum.com/t/undefined-method-symbol-path/162344 "2009-03-09T01:17:51Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![neubyr](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/c37758/32.png) [@neubyr](https://www.ruby-forum.com/u/neubyr)\
**Post date:** [March 9, 2009, 1:17am UTC](https://www.ruby-forum.com/t/undefined-method-symbol-path/162344/1 "2009-03-09T01:17:51Z")

</div>

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: &nbsp;Fill with standard items  
  

Any clues?

CS.

Please someone help me with this… My previous posts have also received  
no response. ☹

---

<div class="post-metadata">

**Author:** ![neubyr](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/c37758/32.png) [@neubyr](https://www.ruby-forum.com/u/neubyr)\
**Post date:** [March 9, 2009, 1:53am UTC](https://www.ruby-forum.com/t/undefined-method-symbol-path/162344/2 "2009-03-09T01:53:50Z")

</div>

On Mar 9, 12:17 am, Carlos S. [removed\_email\_address@domain.invalid](mailto: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

---

<div class="post-metadata">

**Author:** ![neubyr](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/c37758/32.png) [@neubyr](https://www.ruby-forum.com/u/neubyr)\
**Post date:** [March 9, 2009, 2:24am UTC](https://www.ruby-forum.com/t/undefined-method-symbol-path/162344/3 "2009-03-09T02:24:10Z")

</div>

Thanks Fred…

I referred to  
[http://ueckerman.net/2007/04/24/the-basics-of-rest-in-rails/](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: [Undefined variable or method in form\_tag url - Rails - Ruby-Forum](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](mailto: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

---

<div class="post-metadata">

**Author:** ![neubyr](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/c37758/32.png) [@neubyr](https://www.ruby-forum.com/u/neubyr)\
**Post date:** [March 9, 2009, 10:26am UTC](https://www.ruby-forum.com/t/undefined-method-symbol-path/162344/4 "2009-03-09T10:26:20Z")

</div>

On Mar 9, 1:24 am, Carlos S. [removed\_email\_address@domain.invalid](mailto: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

> **[Rails Routing from the Outside In — Ruby on Rails Guides](https://guides.rubyonrails.org/routing.html)**
>
> Rails Routing from the Outside InThis guide covers the user-facing features of Rails routing.After reading this guide, you will know: How to interpret the code in config/routes.rb. How to construct your own routes, using either the preferred...

useful

Fred

---

<div class="post-metadata">

**Author:** ![neubyr](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/c37758/32.png) [@neubyr](https://www.ruby-forum.com/u/neubyr)\
**Post date:** [March 9, 2009, 3:23pm UTC](https://www.ruby-forum.com/t/undefined-method-symbol-path/162344/5 "2009-03-09T15:23:07Z")

</div>

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](mailto: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  
> [Rails Routing from the Outside In — Ruby on Rails Guides](http://guides.rubyonrails.org/routing.html)  
> useful
> 
> Fred
