Manika Suri
2008-May-06 05:04 UTC
ActionController::InvalidAuthenticityToken in ClassifiedCon
I am editing a form it is taking the value but when i submit it it shows the message def edit @classified = Classified.find(params[:id]) end def update @classified = Classified.find(params[:id]) if @classified.update_attributes(params[:classified]) redirect_to :action => ''show'', :id => @classified else render :action => ''edit'' end end and this is my form <form action="../update/<%= @classified.id %>" method="POST"> <input id="_id" name="classified[id]" size="30" type="hidden" value="<%= @classified.id %>" /> <p><b>Title</b><br> <input id="classified_title" name="classified[title]" size="30" type="text" value="<%= @classified.title %>" /> </p> <p><b>Price</b><br> <input id="classified_price" name="classified[price]" size="30" type="text" value="<%= @classified.price %>" /> </p> <p><b>description</b><br> <textarea cols="40" id="classified_description" name="classified[description]" rows="20" wrap="virtual"> <%= @classified.description %> </textarea> </p> <p><b>location</b><br> <input id="classified_location" name="classified[location]" size="30" type="text" value="<%= @classified.location %>" /> </p> <p><b>Email</b><br> <input id="classified_emai;" name="classified[email]" size="30" type="text" value="<%= @classified.email; %>" /> </p> <input type="submit" value="Update" /> </form> -- 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 -~----------~----~----~----~------~----~------~--~---
Daniel Waite
2008-May-06 06:02 UTC
Re: ActionController::InvalidAuthenticityToken in Classified
Manika Suri wrote:> I am editing a form it is taking the value but when i submit it > it shows the messageWhat message?> <input id="classified_emai;" name="classified[email]" > size="30" type="text" > value="<%= @classified.email; %>" /> > </p> > <input type="submit" value="Update" /> > </form>You have a ; where an l should be. Did you copy and paste this code? Is there a reason you''re not using Rails form helpers? -- 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 -~----------~----~----~----~------~----~------~--~---
James Mitchell
2008-May-06 14:55 UTC
Re: ActionController::InvalidAuthenticityToken in ClassifiedCon
Have a look at this thread: http://groups.google.com/group/rubyonrails-talk/browse_thread/thread/8ad8d522cb6ce5f5 On Tue, May 6, 2008 at 1:04 AM, Manika Suri < rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > I am editing a form it is taking the value but when i submit it > it shows the message > > def edit > @classified = Classified.find(params[:id]) > end > > def update > @classified = Classified.find(params[:id]) > if @classified.update_attributes(params[:classified]) > redirect_to :action => ''show'', :id => @classified > else > render :action => ''edit'' > end > end > > and this is my form > <form action="../update/<%= @classified.id %>" method="POST"> > <input id="_id" name="classified[id]" size="30" > type="hidden" value="<%= @classified.id %>" /> > <p><b>Title</b><br> > <input id="classified_title" name="classified[title]" size="30" > type="text" value="<%= @classified.title %>" /> > </p> > <p><b>Price</b><br> > <input id="classified_price" name="classified[price]" > size="30" type="text" > value="<%= @classified.price %>" /> > </p> > > > <p><b>description</b><br> > <textarea cols="40" id="classified_description" > name="classified[description]" > rows="20" wrap="virtual"> > <%= @classified.description %> > </textarea> </p> > <p><b>location</b><br> > <input id="classified_location" name="classified[location]" > size="30" type="text" > value="<%= @classified.location %>" /> > </p> > <p><b>Email</b><br> > <input id="classified_emai;" name="classified[email]" > size="30" type="text" > value="<%= @classified.email; %>" /> > </p> > <input type="submit" value="Update" /> > </form> > -- > Posted via http://www.ruby-forum.com/. > > > >-- James Mitchell --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Possibly Parallel Threads
- NoMethodError in ClassifiedController#update
- Access denied for user 'root'@'localhost'
- ActionController::InvalidAuthenticityToken & :before
- REST Web Service ActionController::InvalidAuthenticityToken
- Disabling Exception Notification for ActionController::InvalidAuthenticityToken