Hell all, I have a layout were I add my stylesheets and javascript in the following manner: <%= stylesheet_link_tag "/form" %> <%= stylesheet_link_tag "/text" %> <%= javascript_include_tag :defaults %> But what happens is that in the actual web page the source is the following: <link href="/form.css?1168168516" media="screen" rel="Stylesheet" type="text/css" /> <link href="/text.css?1167565056" media="screen" rel="Stylesheet" type="text/css" /> <script src="/javascripts/prototype.js?1167563816" type="text/javascript"></script> <script src="/javascripts/effects.js?1167563816" type="text/javascript"></script> <script src="/javascripts/dragdrop.js?1167563816" type="text/javascript"></script> <script src="/javascripts/controls.js?1167563816" type="text/javascript"></script> So Rails is adding some numbers to the links. This breaks my javascripts and stylesheets. Can anyone help me? Thanks. Bye, Migrate -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
augustlilleaas-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-Jan-19 10:10 UTC
Re: Problem with link tags
You can set this in environment.rb. ENV[''RAILS_ASSET_ID''] = "" This is outside of the Rails::Initializer stuff. On Jan 19, 10:27 am, Hu Ma <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Hell all, > I have a layout were I add my stylesheets and javascript in the > following manner: > > <%= stylesheet_link_tag "/form" %> > <%= stylesheet_link_tag "/text" %> > <%= javascript_include_tag :defaults %> > > But what happens is that in the actual web page the source is the > following: > > <link href="/form.css?1168168516" media="screen" rel="Stylesheet" > type="text/css" /> > <link href="/text.css?1167565056" media="screen" rel="Stylesheet" > type="text/css" /> > <script src="/javascripts/prototype.js?1167563816" > type="text/javascript"></script> > <script src="/javascripts/effects.js?1167563816" > type="text/javascript"></script> > <script src="/javascripts/dragdrop.js?1167563816" > type="text/javascript"></script> > <script src="/javascripts/controls.js?1167563816" > type="text/javascript"></script> > > So Rails is adding some numbers to the links. This breaks my javascripts > and stylesheets. Can anyone help me? > > Thanks. > Bye, > Migrate > > -- > Posted viahttp://www.ruby-forum.com/.--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Hu Ma wrote:> > So Rails is adding some numbers to the links. This breaks my javascripts > and stylesheets. Can anyone help me? > > Thanks. > Bye, > MigrateI believe rails does that to bypass any caching that can break scripts. It should not break them though. Are you sure your scripts are in the correct directory? -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
askegg <rails-mailing-list@...> writes:> > > Hu Ma wrote: > > > > So Rails is adding some numbers to the links. This breaks my javascripts > > and stylesheets. Can anyone help me? > > > > Thanks. > > Bye, > > Migrate > > I believe rails does that to bypass any caching that can break scripts. > > It should not break them though. Are you sure your scripts are in the > correct directory? >I''ll second this. It shouldn''t break your files at all. The number is just a timestamp for the last file modification time. It''s there to ensure that any UA which is sloppy about caching will always get new versions of the files when they''re updated. I think the problem is the / in front of your CSS names. This would be look for the CSS files inside your /public directory, whereas they would normally be stored in /public/stylesheets. Using <% stylesheet_link_tag "form" %> will create a link to /stylesheets/form.css which is probably what you''re looking for. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
augustlilleaas-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org wrote:> You can set this in environment.rb. > > ENV[''RAILS_ASSET_ID''] = "" > > This is outside of the Rails::Initializer stuff.Thanks for all your help. There''s no problem with the link tags. I found out that it was my fault. I had them in the wrong place. Bye, Migrate -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---