I get an error saying Rails can''t find the post because I don''t have an id when doing the update. I have: <% form_tag ''/meetings/update'', :id => @calendar.id, :onsubmit => ''return ValidateMeeting()'' do %> Is this wrong? -- 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 16 Sep 2008, at 18:04, Pål Bergström wrote:> > I get an error saying Rails can''t find the post because I don''t have > an > id when doing the update. I have: > > <% form_tag ''/meetings/update'', :id => @calendar.id, :onsubmit => > ''return ValidateMeeting()'' do %> > > Is this wrong?Yes :-) Either you provide a url or you provide a hash of routing options (eg id, action), not a mix of both 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 -~----------~----~----~----~------~----~------~--~---
Frederick Cheung wrote:> On 16 Sep 2008, at 18:04, P�l Bergstr�m wrote: >> Yes :-) > > Either you provide a url or you provide a hash of routing options (eg > id, action), not a mix of both > > FredNot exactly sure what you mean, but I guess I''ll figure that out. Rails form-tags are a bit confusing. -- 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 -~----------~----~----~----~------~----~------~--~---
Pål Bergström wrote:> I get an error saying Rails can''t find the post because I don''t have an > id when doing the update. I have: > > <% form_tag ''/meetings/update'', :id => @calendar.id, :onsubmit => > ''return ValidateMeeting()'' do %> > > > Is this wrong?Have you tried <% form_tag :action => ''update'', :controller => ''meetings'', :id => @calendar.id, :onsubmit => ''return ValidateMeeting()'' do %> That should call the action and the controller that you want. -S -- 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 -~----------~----~----~----~------~----~------~--~---
Shandy Nantz wrote:> Pål Bergström wrote:> Have you tried > > <% form_tag :action => ''update'', :controller => ''meetings'', :id => > @calendar.id, :onsubmit => ''return ValidateMeeting()'' do %> > > That should call the action and the controller that you want. > > -SWill that not give the same form-tag? It might be that I confuse things here. This and mine will give the form-tag and id. I thought that id was the params[:id], but I guess it''s not. It''s just a regular id. I thought a :id in a rails-form would send it as the params[:id]. -- 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 -~----------~----~----~----~------~----~------~--~---
Do you have any routes setup? Why are you updating a "calendar" via the "meetings" controller? This update method should be done via a "calendars" controller, with the following; routes.rb map.resources :calendars views/calendars/update <% form_for(@calendar) do |f| %> <%= f.label :your_field_name %> <%= f.text_field :your_field_name %> <% end %> This will map everything for you properly. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
* the view you want to edit should be.... views/calendars/ edit.html.erb On Sep 17, 8:05 am, Dave S <DaveSh...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Do you have any routes setup? Why are you updating a "calendar" via > the "meetings" controller? This update method should be done via a > "calendars" controller, with the following; > > routes.rb > > map.resources :calendars > > views/calendars/update > > <% form_for(@calendar) do |f| %> > <%= f.label :your_field_name %> > <%= f.text_field :your_field_name %> > <% end %> > > This will map everything for you properly.--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Dave S wrote:> Do you have any routes setup? Why are you updating a "calendar" via > the "meetings" controller? This update method should be done via a > "calendars" controller, with the following; > > routes.rb > > map.resources :calendars > > views/calendars/update > > <% form_for(@calendar) do |f| %> > <%= f.label :your_field_name %> > <%= f.text_field :your_field_name %> > <% end %> > > This will map everything for you properly.I don''t use routes. I don''t see the point in my application. Well actually, I''m not that familiar with it, as I still have to understand the reason for using it. I can understand it in a very straightforward solution, like a GUI to the db, but often it becomes more complex than that. But maybe I''m wrong. -- 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 -~----------~----~----~----~------~----~------~--~---