Displaying 1 result from an estimated 1 matches for "edited_color".
2006 Jul 04
0
Help with first AJAX action
..."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_to :action => "edited_color", :color => @color
end
end
return render :template => "storefront/edit_color", :layout => false
end
def edited_color
@color = Color.find(params["color"].to_i)
render :template => "storefront/edited_color"
end
Here is the RJS:
page.i...