well, i got some issues to get a background image with paperclip, actually i got this
In app/views/layouts/application.html.erb
<head>
...
</head>
<body style="<%= show_user_bg %>">
...
</body>
In app/helpers/application_helper.rb
module ApplicationHelper
def show_user_bg
"background:transparent url(#{@user.background_image}) no-repeat fixed left top;"
end
end
and this module helper
module ApplicationHelper
def show_user_bg
# Show user background
if user_signed_in?
"background:transparent url(#{@user.background_image}) no-repeat fixed left top;"
# Otherwise, show a default background image
else
"background:transparent url('/images/default_bg.png') no-repeat fixed left top;"
end
end
end
but, when i try to get access to the image i dont know where to get it.
resume, i want to get this
<%= image_tag(@user.background.url, :width => "100%") %>
to this
<div style="background:transparent url(#{@user.background.url}) no-repeat fixed left top;">
any help would be appreciated <3 thx!