Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ## Controller code
- def update
- @project = Project.find(params[:id])
- if @project.update_attributes(params[:project])
- if params[:make_featured]
- raise @project.inspect
- config = ApplicationConfigs.find(1)
- config.front_page_featured_project_a = @project[:id]
- config.save
- end
- redirect_to edit_project_path(@project), :notice => "Successfully updated project."
- else
- render :action => 'edit'
- end
- end
- ## Output
- RuntimeError in ProjectsController#update
- #<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