Reputation: 21
After sending the file, the controller executes the render nothing: true, and should show the registered image on the screen.
In a show view, to add a banner field image to a banner category, when uploading the file after refresh, has ActionView :: MissingTemplate response error and headers error 500.
https://i.sstatic.net/OIBOO.png
https://i.sstatic.net/vwDAi.png
change render nothing: true, to render head :ok
banners_controller.rb
class Admin::BannersController < Admin::PositionUpdaterController belongs_to :banner_category, parent_class: BannerCategory
def create @gallery = BannerCategory.find params[:banner_category_id]
@image = @gallery.banners.build
@image.image = params[:file]
@image.save
render nothing: true
end
In a show view, to add a banner field image to a banner category, when uploading the file after refresh, has ActionView :: MissingTemplate response error and headers error 500.
Upvotes: 1
Views: 243
Reputation: 21
I was able to change and render nothing: true, to render json: nil, status :: ok
Upvotes: 1