I just wrote this conditional to a different social area if the client is on ie7 (barf); because two of our social networks no longer properly support ie7 (pinterest/google plus).
I’d like to move the user agent check out of the partial into something that’s cleaner and more human readable. I tried moving the condition to a method named is_this_ie7? in both a helper and controller and both are giving me a undefined method breaks.
Where would this go if I was a more experience RoR Developer? Thanks in advance!!!!
<!-- if ie7 load seperate helper since gplus dones't support -->
<% if request.env['HTTP_USER_AGENT'] =~ /msie 7.0/i %>
<%= share_area_for_bidding_ie7 %>
<% else %>
<!-- if any other browser load main share area -->
<%= share_area_for_bidding %>
<% end %>
It’s better to keep browser sniffing client-side. But if you really have to do it in a Rails template, you can make a helper:
_social.html.erb
application_helper.rb