Skip to content

Instantly share code, notes, and snippets.

@KellyMahan
Created September 1, 2011 19:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save KellyMahan/1187027 to your computer and use it in GitHub Desktop.
Save KellyMahan/1187027 to your computer and use it in GitHub Desktop.
def create
@timesheet = Timesheet.new(params[:timesheet])
@date = @timesheet.start_date
if @timesheet.update_attributes(params[:timesheet])
flash[:notice] = 'Timesheet was successfully saved.'
redirect_to timesheets_path
else
redirect_to timesheets_path
end
end
@KellyMahan
Copy link
Author

def create
@timesheet = Timesheet.new(params[:timesheet])
@Date = @timesheet.start_date
@timesheet.save
if @timesheet.update_attributes(params[:timesheet])
flash[:notice] = 'Timesheet was successfully saved.'
redirect_to timesheets_path
else
redirect_to timesheets_path
end
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment