i would put the image in assets/images and refer to it as:
:url("Jumbotron2.png")
On Tuesday, March 18, 2014 8:45:33 AM UTC-4, mike2r wrote:
>
>
>
> On Tuesday, March 18, 2014 8:01:48 AM UTC-4, Ruby-Forum.com User wrote:
>>
>> mike2r wrote in post #1140207:
>>
>> > I would probably put the image in public/images/Jumbotron2.png and
>> > change
>> > your code the the following:
>> >
>> > $('#jumbotron').css('background-image'
>> :'url("images/Jumbotron2.png")')
>>
>> Unfortunately, that does not work in development or production
>> environments.
>>
>> Thanks,
>>
>> Dave
>>
>> --
>> Posted via http://www.ruby-forum.com/.
>>
>
> sorry, it should have started with the root relative. i tested this and
> it works, but the rest of your syntax threw an error, probably because I
> don't use coffee. This is the line that worked for me:
>
> $('#jumbotron').css('background-image' , 'url("/images/Jumbotron2.png")')
>
> note that the colon between 'background-image' and 'url ...' is now a
> comma. The path to the image now starts with a slash. This is the jquery
> form. The other format you have with a colon may work in coffee. At any
> rate, the path /images/... should work. sorry, i should have tested this
> first.
>
> mike
>
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/rubyonrails-talk/a11b8483-220f-4aab-a1f0-26598fd1cc70%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.