Guest User

Untitled

a guest
Jun 21st, 2018
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. def update
  2. #render :text => params[:news_story].inspect
  3. @news_story = NewsStory.find(params[:id])
  4. for picture in @news_story.pictures
  5. picture.cropped = 0
  6. end
  7. if @news_story.update_attributes(params[:news_story])
  8. flash[:notice] = 'NewsStory was successfully updated.'
  9. if @news_story.all_cropped?
  10. redirect_to @news_story
  11. else
  12. redirect_to :controller => 'croppers', :action => 'new', :picture => @news_story.next_picture_to_crop
  13. end
  14. else
  15. render :action => "edit"
  16. end
  17. end
Add Comment
Please, Sign In to add comment