asset_path doesn't work in models
This commit is contained in:
parent
d539846c61
commit
837abbe9ee
2 changed files with 2 additions and 2 deletions
|
@ -12,7 +12,7 @@ class Map < ActiveRecord::Base
|
||||||
:thumb => ['188x126#', :png]
|
:thumb => ['188x126#', :png]
|
||||||
#:full => ['940x630#', :png]
|
#:full => ['940x630#', :png]
|
||||||
},
|
},
|
||||||
:default_url => asset_path('missing-map.png')
|
:default_url => ActionController::Base.helpers.asset_path('missing-map.png')
|
||||||
|
|
||||||
# Validate the attached image is image/jpg, image/png, etc
|
# Validate the attached image is image/jpg, image/png, etc
|
||||||
validates_attachment_content_type :screenshot, :content_type => /\Aimage\/.*\Z/
|
validates_attachment_content_type :screenshot, :content_type => /\Aimage\/.*\Z/
|
||||||
|
|
|
@ -35,7 +35,7 @@ class User < ActiveRecord::Base
|
||||||
:ninetysix => ['96x96#', :png],
|
:ninetysix => ['96x96#', :png],
|
||||||
:onetwentyeight => ['128x128#', :png]
|
:onetwentyeight => ['128x128#', :png]
|
||||||
},
|
},
|
||||||
:default_url => asset_path('user.png')
|
:default_url => ActionController::Base.helpers.asset_path('user.png')
|
||||||
|
|
||||||
# Validate the attached image is image/jpg, image/png, etc
|
# Validate the attached image is image/jpg, image/png, etc
|
||||||
validates_attachment_content_type :image, :content_type => /\Aimage\/.*\Z/
|
validates_attachment_content_type :image, :content_type => /\Aimage\/.*\Z/
|
||||||
|
|
Loading…
Reference in a new issue