Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- redirect_to :back, notice:'Please select no more than 3 top responses' if @response.post.responses.where(top: true).size > 3
- if @response.update_attribute(:top, params[:response][:top])
- redirect_to :back, notice: 'Top responses have been saved.'
- else
- redirect_to :back, notice: 'Something wrong'
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement