erichexter / twitter.bootstrap.mvc

nuget package to make bootstrap easy with mvc4
Apache License 2.0
248 stars 134 forks source link

Bad url for "Home" controller actions #64

Open sergiomcalzada opened 11 years ago

sergiomcalzada commented 11 years ago

"NavigationRouteConfigurationExtensions" generate incorrect url when a action in HomeController (different from index) is added.

File NavigationRouteConfigurationExtensions, method CreateUrl.

Patch:

public static string CreateUrl(string actionName, string controllerName) { if (controllerName.Equals("home", StringComparison.CurrentCultureIgnoreCase)) { if (actionName.Equals("index", StringComparison.CurrentCultureIgnoreCase)) { return ""; } //else //{ // return actionName.ToLower(); <-- Incorrect url for home controller action //} }

        return controllerName.ToLower() + "/" + actionName.ToLower();
    }
erichexter commented 11 years ago

I dont know why I changed this. :) I will update the unit test and push a change out

Eric Hexter

blog | http://Hex.LosTechies.com info | http://www.linkedin.com/in/erichexter

On Thu, Jan 31, 2013 at 9:34 AM, Sergio notifications@github.com wrote:

"NavigationRouteConfigurationExtensions" generate incorrect url when a action in HomeController (different from index) is added.

File NavigationRouteConfigurationExtensions, method CreateUrl.

Patch:

public static string CreateUrl(string actionName, string controllerName) { if (controllerName.Equals("home", StringComparison.CurrentCultureIgnoreCase)) { if (actionName.Equals("index", StringComparison.CurrentCultureIgnoreCase)) { return ""; } //else //{ // return actionName.ToLower(); <-- Incorrect url for home controller action //} }

    return controllerName.ToLower() + "/" + actionName.ToLower();
}

— Reply to this email directly or view it on GitHubhttps://github.com/erichexter/twitter.bootstrap.mvc/issues/64.

tejpowar commented 11 years ago

Hi

Has this issue been fixed? I know when I use action link and include the the controller name it shows the url with ?length5