I'm trying to insert the URL of the page into uploaded image.
I already have the code like this below but it doesn't work.
Is there something wrong in my model? How can I fix this?
My associations
- User has_one :profile
- Profile belongs_to :user
models/user.rb
before_save :text_to_insert?
def text_to_insert
nickname = self.profile.nickname
end
has_attached_file :user_avatar,
:styles => {
:thumb=> "100x100>",
:small => "400x400>" },
:convert_options => {
:small => '-fill white -undercolor "#00000080" -gravity South -annotate +0+5 " example.com/'+ nickname +' "' }