On 1/24/07, John H. [email protected] wrote:
I ran into the same issue after adding Google anaytics to my pages.
What I ended up doing was to use and if statement in the view to only
output the google analytics for pages that I want to allow it (which
are most my unsecure pages).
That can be as simple as
<%= if @allow_google_analytics %>
google stuff here
<% end -%>
and then in your controller just put a before_filter to call a method
to set the variable when you will want google_analytics.
so you might have something like
@allow_google_analytics = true
As for switching to https from your pages, you can simply use https in
a url or if you are using link_to/url_for helpers then there is a
:protocol option to allow you to change it.
There also is a plugin called ssl_requirement that can be used to
automatically insure you are secure and will redirect if they aren’t.
Depending on your needs this may help as well.
Jeff B., MasterView project founder
Inspired Horizons Ruby on Rails Training and Consultancy
Next Ruby on Rails plus JRuby workshop Feb 22-24 St. Louis, MO
Limited seating, register now!