Created
May 3, 2012 07:30
-
-
Save Znow/2584017 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def update | |
@task = Task.find_by_id(params[:id]) | |
respond_to do |format| | |
if @task.update_attributes(params[:task]) | |
flash[:success] = "<strong>Success!</strong> #{@task.subject} was successfully edited.".html_safe | |
end | |
format.js { render :template => "admin/tasks/update.js.erb", | |
:locals => { :task => @task, :redirect_path => } #admin_tasks_path | |
} # update.js.erb | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery(function($) { | |
<%= render :partial => "admin/shared/modal_ujs", | |
:locals => { | |
:resource => task, | |
:form_el => "edit-task-form#{task.id}", | |
:redirect_path => redirect_path | |
} | |
%> | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment