The following line updates all Zwemmer whose id = zwemmer.id to blatest4
<td><%= link_to ''Over'' , Zwemmer.update(zwemmer.id,
:groep =>
"blatest4")%></td>
change the link to point to the update action and pass the zwemmer id,
much like along the lines of
<td><%= link_to ''Over'', zwemmer_path(zwemmer,
:zwemmer => {:groep =>
"blatest4"}), :method => :put %></td>
On Thu, Feb 10, 2011 at 8:35 PM, Kelly Pfaff
<lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:
> Code is from the view. If a user clicks the ''Over'' link,
i want to
> update the :groep attribute of the zwemmer to ''blatest4''.
But now, all
> the zwemmers :groep are changed when the page loads. How can i fix this?
> code:
> http://pastie.org/1548696
>
> --
> 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> To unsubscribe from this group, send email to
>
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> For more options, visit this group at
> http://groups.google.com/group/rubyonrails-talk?hl=en.
>
>
--
-------------------------------------------------------------
visit my blog at http://jimlabs.heroku.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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.