On 27 October 2011 21:32, Max <[email protected]> wrote:
> HI all,
>
> I have an index page in my site and each item displayed from the model
> has a link (that looks like a button)... I want that link to simply
> clear a field (or set it to some value) in the underlying model for
> that entry... The page does not have a form on it and i'd like to
> avoid that if possible....
>
> seems i should be able to select the link and have it process an
> update on the item behind the scenes and then re-display the page (or
> if i get fancier later - use ajax to red-display the item?)...
>
> I hope this makes sense... i'm obviously new to web dev AND rails...

A simple way, avoiding AJAX and so on until you have more experience,
is to have an empty form with just the submit button.  To the user it
will just look like a button but Rails will do all the clever stuff
for you.  You just need to provide the action and (if appropriate)
re-display the same view.

Colin

-- 
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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to