Hi, I have the following, very simple, simple layout - <html> <head> <%= title_tag %> <%= stylesheet_link_tag %> </head> <body> <h1>Main Title</h1> <P>Up until this point, the HTML''s coming from the application layout.</p> <%= @content_for_layout %> </body> </html> which renders fine but without a stylesheet tag in the HTML. If I change the stylesheet tag to - <%= stylesheet_link_tag "main", "blog", :media => "all" %> or even <%= stylesheet_link_tag "main" %> - then I get an exception raised - wrong number of arguments (2 for 0) I have a number of options for working around this, but I''d like to understand where I''m going wrong. Anyone care to enlighten me? TIA. Gordon --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
hey man, I just pulled this from my working template: <%= stylesheet_link_tag ''style'' %> the only difference I can see is you used double quotes, I''m on singles, see if that helps. I guess its not rendering a style tag because you haven''t passed it any parameters like name etc... Im still learning myself so I may be wrong, but you never know! cheers, Lee On Apr 14, 11:00 pm, Gordon Robertson <gordon.robert...-Kv8S2SFUxhUe5n95sSBpClpr/1R2p/CL@public.gmane.org> wrote:> Hi, > > I have the following, very simple, simple layout - > > <html> > <head> > <%= title_tag %> > <%= stylesheet_link_tag %> > </head> > > <body> > <h1>Main Title</h1> > <P>Up until this point, the HTML''s coming from the application > layout.</p> > <%= @content_for_layout %> > </body> > > </html> > > which renders fine but without a stylesheet tag in the HTML. If I > change the stylesheet tag to - > <%= stylesheet_link_tag "main", "blog", :media => "all" %> or even > <%= stylesheet_link_tag "main" %> > > - then I get an exception raised - > > wrong number of arguments (2 for 0) > > I have a number of options for working around this, but I''d like to > understand where I''m going wrong. Anyone care to enlighten me? TIA. > > Gordon--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Nope, still getting the exception. I''ve got a stack trace which points me at the method which is throwing the exception. I guess I''m going to have to dig around in the code and see if I can work it out. Gordon On Apr 14, 11:23 pm, lee farrar <l.m.far...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> hey man, > > I just pulled this from my working template: > <%= stylesheet_link_tag ''style'' %> > > the only difference I can see is you used double quotes, I''m on > singles, see if that helps. I guess its not rendering a style tag > because you haven''t passed it any parameters like name etc... > > Im still learning myself so I may be wrong, but you never know! > > cheers, > Lee > > On Apr 14, 11:00 pm, Gordon Robertson > > <gordon.robert...-Kv8S2SFUxhUe5n95sSBpClpr/1R2p/CL@public.gmane.org> wrote: > > Hi, > > > I have the following, very simple, simple layout - > > > <html> > > <head> > > <%= title_tag %> > > <%= stylesheet_link_tag %> > > </head> > > > <body> > > <h1>Main Title</h1> > > <P>Up until this point, the HTML''s coming from the application > > layout.</p> > > <%= @content_for_layout %> > > </body> > > > </html> > > > which renders fine but without a stylesheet tag in the HTML. If I > > change the stylesheet tag to - > > <%= stylesheet_link_tag "main", "blog", :media => "all" %> or even > > <%= stylesheet_link_tag "main" %> > > > - then I get an exception raised - > > > wrong number of arguments (2 for 0) > > > I have a number of options for working around this, but I''d like to > > understand where I''m going wrong. Anyone care to enlighten me? TIA. > > > Gordon--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
> Nope, still getting the exception. I''ve got a stack trace which points > me at the method which is throwing the exception. I guess I''m going to > have to dig around in the code and see if I can work it out.Do you get the same exception when <%= title_tag %> is removed? Regards -- Rimantas, http://rimantas.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 -~----------~----~----~----~------~----~------~--~---
Hi, That''s REALLY odd. What happens if you have nothing but the stylesheet link tag in your layout? Julian. Learn Ruby on Rails! Check out the FREE VIDS (for a limited time) VIDEO #4 coming soon! http://sensei.zenunit.com/ On 15/04/2008, at 8:00 AM, Gordon Robertson wrote:> > Hi, > > I have the following, very simple, simple layout - > > <html> > <head> > <%= title_tag %> > <%= stylesheet_link_tag %> > </head> > > <body> > <h1>Main Title</h1> > <P>Up until this point, the HTML''s coming from the application > layout.</p> > <%= @content_for_layout %> > </body> > > </html> > > which renders fine but without a stylesheet tag in the HTML. If I > change the stylesheet tag to - > <%= stylesheet_link_tag "main", "blog", :media => "all" %> or even > <%= stylesheet_link_tag "main" %> > > - then I get an exception raised - > > wrong number of arguments (2 for 0) > > I have a number of options for working around this, but I''d like to > understand where I''m going wrong. Anyone care to enlighten me? TIA. > > Gordon > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
I see where you''re going with this. Is it my dodgy helper method? :). Unfortunately not, I get the same error. Gordon On Apr 15, 12:01 am, "Rimantas Liubertas" <riman...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Nope, still getting the exception. I''ve got a stack trace which points > > me at the method which is throwing the exception. I guess I''m going to > > have to dig around in the code and see if I can work it out. > > Do you get the same exception when <%= title_tag %> is removed? > > Regards > -- > Rimantas,http://rimantas.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 -~----------~----~----~----~------~----~------~--~---
If I have a layout with only this - <%= stylesheet_tag %> , then I get this rendered - <link rel="stylesheet" href="stylesheets/main.css" type="text/css" /> OTOH, if I have a layout with only this line - <%= stylesheet_tag ''main'' %>, then I get a "wrong number of arguments" exception. Gordon On Apr 15, 4:41 am, Julian Leviston <jul...-AfxEtdRqmE/tt0EhB6fy4g@public.gmane.org> wrote:> Hi, > > That''s REALLY odd. > > What happens if you have nothing but the stylesheet link tag in your > layout? > > Julian. > > Learn Ruby on Rails! Check out the FREE VIDS (for a limited time) > VIDEO #4 coming soon!http://sensei.zenunit.com/ > > On 15/04/2008, at 8:00 AM, Gordon Robertson wrote: > > > > > Hi, > > > I have the following, very simple, simple layout - > > > <html> > > <head> > > <%= title_tag %> > > <%= stylesheet_link_tag %> > > </head> > > > <body> > > <h1>Main Title</h1> > > <P>Up until this point, the HTML''s coming from the application > > layout.</p> > > <%= @content_for_layout %> > > </body> > > > </html> > > > which renders fine but without a stylesheet tag in the HTML. If I > > change the stylesheet tag to - > > <%= stylesheet_link_tag "main", "blog", :media => "all" %> or even > > <%= stylesheet_link_tag "main" %> > > > - then I get an exception raised - > > > wrong number of arguments (2 for 0) > > > I have a number of options for working around this, but I''d like to > > understand where I''m going wrong. Anyone care to enlighten me? TIA. > > > Gordon--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Gordon Robertson wrote:> which renders fine but without a stylesheet tag in the HTML. If I > change the stylesheet tag to - > <%= stylesheet_link_tag "main", "blog", :media => "all" %> or even > <%= stylesheet_link_tag "main" %> > > - then I get an exception raised - > > wrong number of arguments (2 for 0) > > I have a number of options for working around this, but I''d like to > understand where I''m going wrong. Anyone care to enlighten me? TIA.stylesheet_link_tag with no parameters appears to be an error according to the comments in the helper method that handles this tag. Your last option should work, though (with just "main" as a parameter). You *do* have a css file called "main.css" in your public/stylesheets directory, right? You could also try: <%= stylesheet_link_tag :all %> ...which is supposed to make style link tags for all the .css files in your stylesheets directory. - Aaron --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Yep, there''s a main.css in public/stylesheets. I just tried it with :all. Got the same exception. Gordon On Apr 15, 10:58 pm, Aaron Brown <aarondaltonbr...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Gordon Robertson wrote: > > which renders fine but without a stylesheet tag in the HTML. If I > > change the stylesheet tag to - > > <%= stylesheet_link_tag "main", "blog", :media => "all" %> or even > > <%= stylesheet_link_tag "main" %> > > > - then I get an exception raised - > > > wrong number of arguments (2 for 0) > > > I have a number of options for working around this, but I''d like to > > understand where I''m going wrong. Anyone care to enlighten me? TIA. > > stylesheet_link_tag with no parameters appears to be an error according > to the comments in the helper method that handles this tag. Your last > option should work, though (with just "main" as a parameter). You *do* > have a css file called "main.css" in your public/stylesheets directory, > right? > > You could also try: > <%= stylesheet_link_tag :all %> > > ...which is supposed to make style link tags for all the .css files in > your stylesheets directory. > > - Aaron--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Ah, cracked it. I had a helper method named stylesheet_tag in application_helper.rb. This was clashing with the identically named method in action_view/helpers/asset_tag_helper.rb. Gordon Gordon Robertson wrote:> Yep, there''s a main.css in public/stylesheets. > > I just tried it with :all. Got the same exception. > > Gordon > > > On Apr 15, 10:58 pm, Aaron Brown <aarondaltonbr...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > Gordon Robertson wrote: > > > which renders fine but without a stylesheet tag in the HTML. If I > > > change the stylesheet tag to - > > > <%= stylesheet_link_tag "main", "blog", :media => "all" %> or even > > > <%= stylesheet_link_tag "main" %> > > > > > - then I get an exception raised - > > > > > wrong number of arguments (2 for 0) > > > > > I have a number of options for working around this, but I''d like to > > > understand where I''m going wrong. Anyone care to enlighten me? TIA. > > > > stylesheet_link_tag with no parameters appears to be an error according > > to the comments in the helper method that handles this tag. Your last > > option should work, though (with just "main" as a parameter). You *do* > > have a css file called "main.css" in your public/stylesheets directory, > > right? > > > > You could also try: > > <%= stylesheet_link_tag :all %> > > > > ...which is supposed to make style link tags for all the .css files in > > your stylesheets directory. > > > > - Aaron--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---