app/controllers/your_data_controller.rb
def update_activity
    assert_params_must_have :id
    render :partial => "/users/no_permissions", :layout => "main" and return false unless @activity.editable_by? @current_user

    @projects = Project.find(:all)
    # convert hours format to minutes
    params[:activity]['minutes'] = Activity.convert_duration(params[:activity]['minutes'])

    if @activity.update_attributes(params[:activity])
        flash[:notice] = 'Activity has been successfully updated'
        redirect_to :action => 'activities_list', :id => @activity
    else
        flash[:notice] = 'Errors with updating activities'
        render :action => 'edit_activity'
    end
  end
#
# Updates activity details. Data is validated before.
#

Updates activity details. Data is validated before.
Updates activity details . Data is validated before .
def update_activity
    assert_params_must_have :id
    render :partial => "/users/no_permissions", :layout => "main" and return false unless @activity.editable_by? @current_user
    @projects = Project.find(:all)
    params[:activity]['minutes'] = Activity.convert_duration(params[:activity]['minutes'])
    if @activity.update_attributes(params[:activity])
        flash[:notice] = 'Activity has been successfully updated'
        redirect_to :action => 'activities_list', :id => @activity
    else
        flash[:notice] = 'Errors with updating activities'
        render :action => 'edit_activity'
    end
  end
def update_activity assert_params_must_have :id render :partial => "/users/no_permissions" , :layout => "main" and return false unless @activity . editable_by? @current_user @projects = Project . find ( :all ) params [ :activity ] [ 'minutes' ] = Activity . convert_duration ( params [ :activity ] [ 'minutes' ] ) if @activity . update_attributes ( params [ :activity ] ) flash [ :notice ] = 'Activity has been successfully updated' redirect_to :action => 'activities_list' , :id => @activity else flash [ :notice ] = 'Errors with updating activities' render :action => 'edit_activity' end end
Updates activity details.
Updates activity details .
# convert hours format to minutes
