This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# config/application.rb | |
module KittenFactory | |
class Application < Rails::Application | |
# Disable generation of helpers, javascripts, css, and view specs | |
config.generators do |generate| | |
generate.helper false | |
generate.assets false | |
generate.view_specs false | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "open-uri" | |
class PhotosController < ApplicationController | |
def update | |
photo = Photo.find(params[:id]) | |
# Open the url that's been returned by Filepicker. | |
# Then remove the pic from params so it doesn't get updated | |
# via update_attributes, which will cause a validation error | |
if params[:photo][:pic_selected] == "true" && params[:photo][:pic] != '/default_images/original/missing.png' | |
url = params[:photo][:pic] |