Here is my photo_shouts controller:
class PhotoShoutsController < ApplicationController
def create
content = build_content
shout = current_user.shouts.build(content: content)
if shout.save
redirect_to dashboard_path
else
flash.alert = 'Can\'t shout BLANKS'
redirect_to dashboard_path
end
end
private
def build_content
PhotoShout.new(photo_shout_parameters)
end
def photo_shout_parameters
params.require(:photo_shout).permit(:image)
end
end
in my _photo_shout.htm.erb
partial:
<%= image_tag photo_shout.image.url(:shout) %>
I am still getting a partial error in the browser. Could be a one off, but I’ve been reviewing the video over and over, not sure where I’m goin wrong.