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/0d830792-7fa9-4012-8656-7234bbac7230%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to