[Ovirt-devel] [PATCH server] Bugfix for dashboard link.

Hugh O. Brock hbrock at redhat.com
Fri Mar 27 14:24:26 UTC 2009


On Tue, Mar 24, 2009 at 11:36:39AM -0400, Jason Guiditta wrote:
> Because of the way we were constructing the route,
> the dashboard link could point to the admin network, when
> what we want is for it to point where all other links
> point.
> 
> Signed-off-by: Jason Guiditta <jason.guiditta at gmail.com>
> ---
>  src/app/views/layouts/_tree.rhtml |    3 ++-
>  src/config/routes.rb              |    1 -
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/src/app/views/layouts/_tree.rhtml b/src/app/views/layouts/_tree.rhtml
> index e3a0729..de12927 100644
> --- a/src/app/views/layouts/_tree.rhtml
> +++ b/src/app/views/layouts/_tree.rhtml
> @@ -22,6 +22,7 @@
>                $.ajax({
>                  url: this.href,
>                  dataType: 'html',
> +                data: {ajax:true},
>                  success: handleTabsAndContent,
>                  error: function(xhr) {$.jGrowl(xhr.status + ' ' + xhr.statusText);}
>                });
> @@ -100,7 +101,7 @@
>  <!-- Output elements -->
>  <% selected = "current" if controller.controller_name == "dashboard" && params[:action] == "index" %>
>  <div class="nav-dashboard <%= selected %>">
> -  <%= link_to "Dashboard", dashboard_url, { :id => "dashboard"} %>
> +  <%= link_to "Dashboard", {:controller => "dashboard"} %>
>  </div>
>  <% network_selected = "current" if controller.controller_name == "network" %>
>  
> diff --git a/src/config/routes.rb b/src/config/routes.rb
> index d286c3f..795f022 100644
> --- a/src/config/routes.rb
> +++ b/src/config/routes.rb
> @@ -32,7 +32,6 @@ ActionController::Routing::Routes.draw do |map|
>    # You can have the root of your site routed by hooking up '' 
>    # -- just remember to delete public/index.html.
>    map.default '', :controller => 'dashboard'
> -  map.dashboard '/dashboard?ajax=true', :controller => 'dashboard'
>  
>    map.login '/login', :controller => 'resources', :action => 'list'
>    map.logout '/logout', :controller => 'resources', :action => 'list'

Tested on demo server, works. ACK.

--H




More information about the ovirt-devel mailing list