Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #15 from CharlonTank/RT_sponsors
Add sponsor logo uploader
- Loading branch information
Showing
9 changed files
with
101 additions
and
42 deletions.
There are no files selected for viewing
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
class Sponsor < ActiveRecord::Base | ||
attr_accessible :from, :name, :until | ||
attr_accessible :from, :name, :until, :logo | ||
mount_uploader :logo, PictureUploader | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
class PictureUploader < CarrierWave::Uploader::Base | ||
include Cloudinary::CarrierWave | ||
|
||
version :thumbnail do | ||
resize_to_fit(50, 50) | ||
end | ||
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
--- | ||
development: | ||
cloud_name: hmdgjw97p | ||
api_key: '426858336164834' | ||
api_secret: zxgYSZUnq2N84gHKkhYxfHc5btc | ||
enhance_image_tag: true | ||
static_image_support: false | ||
production: | ||
cloud_name: hmdgjw97p | ||
api_key: '426858336164834' | ||
api_secret: zxgYSZUnq2N84gHKkhYxfHc5btc | ||
enhance_image_tag: true | ||
static_image_support: true | ||
test: | ||
cloud_name: hmdgjw97p | ||
api_key: '426858336164834' | ||
api_secret: zxgYSZUnq2N84gHKkhYxfHc5btc | ||
enhance_image_tag: true | ||
static_image_support: false |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
class AddLogoToSponsor < ActiveRecord::Migration | ||
def change | ||
add_column :sponsors, :logo, :string | ||
end | ||
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