Displaying 1 result from an estimated 1 matches for "list_colors".
Did you mean:
list_color
2006 Jul 04
0
Help with first AJAX action
...ions are clicked (I.e.
edit/add) the controls div is replaced by the form that performs the
action. When the action is submitted, the controls div reverts to the
list of available actions and the page is updated to reflect the
change via an RJS template.
So, as a concrete example, I have a list_colors action with a link to
"Add color", which links to an edit_color action. The action looks
like this:
def edit_color
@color = Color.find_by_id(params[:id]) || Color.new
if request.post? and params[:color]
@color.attributes = params[:color]
if @color.save
return redirect_t...