Skip to content

Instantly share code, notes, and snippets.

@nathanpalmer
Created May 6, 2022 16:56
Show Gist options
  • Save nathanpalmer/e04f8cdd3102467f2be064fe134e6171 to your computer and use it in GitHub Desktop.
Save nathanpalmer/e04f8cdd3102467f2be064fe134e6171 to your computer and use it in GitHub Desktop.
# app/controllers/quotes_controller.rb
def create
@quote = current_company.quotes.build(quote_params)
if @quote.save
respond_to do |format|
format.html { redirect_to quotes_path, notice: "Quote was successfully created." }
format.turbo_stream { flash.now[:notice] = "Quote was successfully created." }
end
else
render :new
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment