Displaying 1 result from an estimated 1 matches for "exercises_count".
2006 Apr 19
1
AJAX - update item forms problem
...end_form_tag %>
</td>
</tr>
workouts_controller.rb
----------------------
def show_workout_update_form
@workout_id = params[:id]
end
def hide_workout_update_form
@workout_id = params[:id]
end
def update
@workout = Workout.find(params[:id])
@workout.exercises_count = @workout.exercises.count
@saved = @workout.update_attributes(params[:workout])
return if request.xhr? # render RJS instead
update.rjs
----------
if @saved
page.hide "workout_edit_#{@workout.id.to_s}"
flash[:notice] = "Workout updated."
session[:workout_yellow] =...