[BioCatalogue-developers] [2287] trunk/app/views/shared/_listing_type_switcher.html.erb: fix to keep user on current page when view types are switched

Jiten Bhagat jits at cs.man.ac.uk
Wed Nov 3 11:00:32 EDT 2010


Hi Eric,

Instead of using "params[:page]" please use the "@page" variable.

Thanks.
Jits


noreply at rubyforge.org wrote:
>
> Revision
>     2287
> Author
>     ebontane
> Date
>     2010-11-03 10:08:15 -0400 (Wed, 03 Nov 2010)
>
>
>       Log Message
>
> fix to keep user on current page when view types are switched
>
>
>       Modified Paths
>
>     * trunk/app/views/shared/_listing_type_switcher.html.erb
>       <#trunkappviewsshared_listing_type_switcherhtmlerb>
>
>
>       Diff
>
>
>         Modified:
>         trunk/app/views/shared/_listing_type_switcher.html.erb (2286
>         => 2287)
>
>
> --- trunk/app/views/shared/_listing_type_switcher.html.erb	2010-11-03 12:19:10 UTC (rev 2286)
> +++ trunk/app/views/shared/_listing_type_switcher.html.erb	2010-11-03 14:08:15 UTC (rev 2287)
> @@ -14,8 +14,8 @@
>  %>
>  
>  <% if @listing_type == :simple %>
> -	<%= link_to content_tag(:span, "Switch to Detailed View"), base_url_lambda.call({ :listing => :detailed }), :class => "button_slim", :style => "#{style}" -%>
> +	<%= link_to content_tag(:span, "Switch to Detailed View"), base_url_lambda.call({ :listing => :detailed, :page => params[:page] }), :class => "button_slim", :style => "#{style}" -%>
>  <% elsif @listing_type == :detailed %>
> -	<%= link_to content_tag(:span, "Switch to Simple View"), base_url_lambda.call({ :listing => :simple }), :class => "button_slim", :style => "#{style}"  -%>
> +	<%= link_to content_tag(:span, "Switch to Simple View"), base_url_lambda.call({ :listing => :simple , :page => params[:page] }), :class => "button_slim", :style => "#{style}"  -%>
>  <% end %>
>  
> ------------------------------------------------------------------------
>
> _______________________________________________
> BioCatalogue-developers mailing list
> BioCatalogue-developers at rubyforge.org
> http://rubyforge.org/mailman/listinfo/biocatalogue-developers
>   



More information about the BioCatalogue-developers mailing list