HAML including CSS and JavaScript

1,305 views
Skip to first unread message

Gerő Zoltán

unread,
Nov 27, 2010, 9:08:22 PM11/27/10
to rubyonra...@googlegroups.com, rubyonra...@googlegroups.com
Hello, 

how to include CSS file with Haml? Every way I tried puts the href=... infos after the tag, not inside, like:
<style>href="style.css" rel="stylesheet" type="text/css"</style>

In reference I onlye read about JavaScript, not any word about CSS. But Javascript also didn't worked, how should make include it?

Thanks in advance,
Zoltán

Gerő Zoltán

unread,
Nov 27, 2010, 9:20:47 PM11/27/10
to rubyonra...@googlegroups.com, rubyonra...@googlegroups.com
Sorry, "half-solved", this was the solution:

%link(rel="stylesheet" type="text/css" href="style.css")

Without space between link and ( and in Sinatra /public/ is not necessary, this is default, so it will find the CSS file there.

Maybe others will have the same problem, so I shared. But JavaScript still doesn't want to be included, please help.
Thanks,
Zoltán

2010/11/28 Gerő Zoltán <gez...@gmail.com>

Ryan Bigg

unread,
Nov 28, 2010, 2:12:58 AM11/28/10
to rubyonra...@googlegroups.com

Please ask questions such as this only on rubyonrails-talk, not rubyonrails-core. Core is reserved for discussion such as patches or feature requests to the framework.

Thank you.

-- 
Ryan Bigg
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group.
To post to this group, send email to rubyonra...@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-co...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.

Reply all
Reply to author
Forward
0 new messages