Skip to content

Instantly share code, notes, and snippets.

@eqbal
Created December 6, 2016 13:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save eqbal/805906b65ab08332d04a46ca13eac2b2 to your computer and use it in GitHub Desktop.
Save eqbal/805906b65ab08332d04a46ca13eac2b2 to your computer and use it in GitHub Desktop.
def create
@entry = Entry.new(entry_params)
@entry.user_id = current_user.id
@entry.status = EntryStatus.new(
entry_params[:status_weather],
entry_params[:status_landform]
)
if @entry.save
flash[:notice] = "Entry was successfully created."
else
flash[:error] = @entry.errors.full_messages.to_sentence
end
redirect_to root_path
end
@chabgood
Copy link

That method is still a bit big.

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