Reputation: 1063
I have a Rails 3.1 app with HAML and I'm trying to set up the homepage with links to other sites. My Haml code looks like this:
.home-container
%section.news
%a{:href => "http://www.google.com"} Google
The page is the home page that gets yielded to the application and there's a sidebar partial that gets rendered after it that has a Twitter feed. I have tried a ton of syntaxs for links including regular html and all I get is the text, the link is not actually clickable so nothing happens when I click it. I have tested it in both Firefox and Chrome and I can see in the inspector that it's an actual link although I can inspect the element directly, I have to open up the body, divs, etc. Google search is coming up completely fruitless.
I have no idea what's going on and what other possible information would be relevant. Let me know if any more details are needed.
Upvotes: 0
Views: 730
Reputation: 1063
So with some help from a friend, the problem was the CSS. Specifically the content of the home-container was given a z-index of -1 with the header and picture getting a z-index of 1 and 2 without any relative positioning. So the content was getting put behind the header content so I couldn't click on any of the links. After removing the z-index of -1 from the content, it now works and I can click the link. To add the z-index back, I made the content 1 and the header 2 and added, position: relative; to the css of both.
Upvotes: 2
Reputation: 16629
try
.home-container
%section.news
%= link_to 'Google', "http://www.google.com"
Upvotes: 0