As per the error,
ActionView::MissingTemplate (Missing template canvases/edit, application/edit with {:locale=>[:en], :formats=>[:json], :handlers=>[:erb, :builder, :raw, :ruby, :jbuilder, :coffee]}. Searched in:
* "/Users/colmtuite/dev/design_tool/app/views"
):
You don't have edit
view for canvases
. Make sure that you have edit.html.erb
file in app/views/canvases
folder.
UPDATE
Also, I noticed that the request is going for Processing by CanvasesController#edit as JSON
,
NOTE the format is JSON
and not HTML
. If you have edit.html.erb
file and you want to render that particular view, make sure that you don't specify format as 'JSON' while calling edit
action so by default format would be considered as HTML
.
Change your update
action as below:
def update
@canvas = Canvas.find(params[:id])
if @canvas.update_attributes(update_params)
redirect_to edit_canvas_path(@canvas, format: :html) ## Specify format as html
else
render :edit
end
end