Guest User

Untitled

a guest
Dec 11th, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.01 KB | None | 0 0
  1. ## Controller code
  2.  
  3. def update
  4. @project = Project.find(params[:id])
  5. if @project.update_attributes(params[:project])
  6. if params[:make_featured]
  7. raise @project.inspect
  8. config = ApplicationConfigs.find(1)
  9. config.front_page_featured_project_a = @project[:id]
  10. config.save
  11. end
  12. redirect_to edit_project_path(@project), :notice => "Successfully updated project."
  13. else
  14. render :action => 'edit'
  15. end
  16. end
  17.  
  18.  
  19.  
  20. ## Output
  21.  
  22. RuntimeError in ProjectsController#update
  23.  
  24. #<Project id: 1, title: "title", summary: "", link: "", created_at: "2011-05-10 14:02:21", updated_at: "2011-05-10 14:24:27", main_image_file_name: nil, main_image_content_type: nil, main_image_file_size: nil, main_image_updated_at: nil, cached_slug: "title", in_selected_projects_list: false, thumbnail_image_file_name: nil, thumbnail_image_content_type: nil, thumbnail_image_file_size: nil, thumbnail_image_updated_at: nil, featured_project_title: "", featured_project_summary: "">
Add Comment
Please, Sign In to add comment