Topic: A plea for help
Hello all,
I am a very noobish developer-in-the-making and I am hung up on getting some eRb/HAML/CSS/etc/etc to play nice together.
Inside my _headers.html.haml file I have this:
=link_to_language "English", :en
=link_to_language "France", :fr
My Application_helper.rb has this:
def link_to_language name, locale
uri = URI.parse(request.fullpath)
uri.path.gsub!(/(^\/en)|(^\/fr)|^/, "/#{locale}")
link_to name, uri.to_s
end
end
My application_controller.rb has this:
def set_locale
I18n.locale = params[:locale] || request.compatible_language_from(['en', 'fr'])
end
def default_url_options(options={})
{ :locale => I18n.locale }
end
And this is my CSS that I want to use:
#engbutton{
background:url(public/images/useng.gif) no-repeat;
cursor:pointer;
width: 45px;
height: 28px;
border: none;
}
#frbutton{
background:url(public/images/france.jpg) no-repeat;
cursor:pointer;
width: 45px;
height: 28px;
border: none;
}
How would I go about making the =link_to_language "" code in my .haml display the CSS images?
Any help would be great and deeply appreciated, thanks Rails community!