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: <h1>New Topic</h1> 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<br /><br /> Any clues? CS. Please someone help me with this... My previous posts have also received no response. :( -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On Mar 9, 12:17 am, Carlos Santana <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> 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: <h1>New Topic</h1> > 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: <%= render :partial => ''topic_form'', :object => @topic %> > 5: <%= check_box_tag :make_standard, :true, @standard%> > 6: Fill with standard items<br /><br /> > > Any clues? > > CS. > > Please someone help me with this... My previous posts have also received > no response. :( > -- > Posted viahttp://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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
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 Cheung wrote:> On Mar 9, 12:17�am, Carlos Santana <rails-mailing-l...@andreas-s.net> > 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: <h1>New Topic</h1> >> 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-- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On Mar 9, 1:24 am, Carlos Santana <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> 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> 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 Cheung wrote: > > On Mar 9, 12:17 am, Carlos Santana <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> > > 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: <h1>New Topic</h1> > >> 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 > > -- > Posted viahttp://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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
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 Cheung wrote:> On Mar 9, 1:24�am, Carlos Santana <rails-mailing-l...@andreas-s.net> > 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-- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---