Skip to content

Commit

Permalink
Made the solution F5-able. You can now host the hello world sample in…
Browse files Browse the repository at this point in the history
… IIS
  • Loading branch information
casualjim committed Mar 28, 2009
1 parent 7344b8c commit c2ab2f4
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 68 deletions.
2 changes: 1 addition & 1 deletion IronRubyMvc.Tests/Controllers/RubyControllerSpec.cs
Expand Up @@ -83,7 +83,7 @@ public void should_have_the_correct_controller_name()
[Concern(typeof (RubyController))]
public class when_being_asked_for_the_params : when_a_controller_is_initialized
{
private IDictionary<object, object> _params;
private IDictionary<SymbolId, object> _params;

protected override void EstablishContext()
{
Expand Down
45 changes: 0 additions & 45 deletions IronRubyMvc/Controllers/ParamsBinder.cs
Expand Up @@ -26,56 +26,11 @@ public object BindModel(ControllerContext controllerContext, ModelBindingContext
bindingContext.ModelState.SetModelValue(pair.Key, pair.Value);
_params.Add(pair.Key.ToSymbolId(), pair.Value.AttemptedValue);
});
// var request = controllerContext.HttpContext.Request;
// var modelState = controllerContext.Controller.ViewData.ModelState;
//
// PopulateParamsWithFormData(request, modelState);
// PopulateParamsWithQueryStringData(request, modelState);
// PopulateParamsWithRouteData(controllerContext.RouteData.Values);

return _params;
}

#endregion

// private void PopulateParamsWithFormData(HttpRequestBase request, IDictionary<string, ModelState> modelState)
// {
// foreach (string key in request.Form.Keys)
// {
// var symbolKey = SymbolTable.StringToId(key);
// _params[symbolKey] = request.Form[key];
// modelState.Add(key, CreateModelState(request.Form[key]));
// }
// }
//
// private void PopulateParamsWithQueryStringData(HttpRequestBase request, IDictionary<string, ModelState> modelState)
// {
// foreach (string key in request.QueryString.Keys)
// {
// var symbolKey = SymbolTable.StringToId(key);
// var value = request.QueryString[key];
// _params[symbolKey] = value;
// modelState.Add(key, CreateModelState(value));
// }
// }
//
// private void PopulateParamsWithRouteData(IEnumerable<KeyValuePair<string, object>> routeValueDictionary)
// {
// foreach (var item in routeValueDictionary)
// {
// var key = SymbolTable.StringToId(item.Key);
// _params[key] = item.Value;
// }
// }
//
// private static ModelState CreateModelState(string value)
// {
// return new ModelState {Value = CreateValueProviderResult(value)};
// }
//
// private static ValueProviderResult CreateValueProviderResult(string value)
// {
// return new ValueProviderResult(value, value, CultureInfo.CurrentCulture);
// }
}
}
1 change: 0 additions & 1 deletion IronRubyMvc/Controllers/RubyController.cs
Expand Up @@ -67,7 +67,6 @@ internal void InternalInitialize(ControllerConfiguration config)
ControllerName = config.RubyClass.Name.Replace("Controller", string.Empty);
RubyType = config.RubyClass;
Binders = RubyModelBinders.Binders;
// ValueProvider = new RubyValueProviderDictionary(ControllerContext);
}

protected override void Execute(RequestContext requestContext)
Expand Down
43 changes: 22 additions & 21 deletions IronRubyMvcWeb/Web.config
Expand Up @@ -104,25 +104,26 @@
The system.webServer section is required for running ASP.NET AJAX under Internet
Information Services 7.0. It is not necessary for previous version of IIS.
-->
<system.webServer>
<validation validateIntegratedModeConfiguration="false"/>
<modules runAllManagedModulesForAllRequests="true">
<remove name="ScriptModule"/>
<remove name="UrlRoutingModule"/>
<add name="ScriptModule" preCondition="managedHandler" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add name="UrlRoutingModule" type="System.Web.Routing.UrlRoutingModule, System.Web.Routing, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
</modules>
<handlers>
<remove name="WebServiceHandlerFactory-Integrated"/>
<remove name="ScriptHandlerFactory"/>
<remove name="ScriptHandlerFactoryAppServices"/>
<remove name="ScriptResource"/>
<add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add name="MvcScriptMap" preCondition="classicMode,bitness32" verb="*" path="*.mvc" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll"/>
<add name="MvcScriptMap64" preCondition="classicMode,bitness64" verb="*" path="*.mvc" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v2.0.50727\aspnet_isapi.dll"/>
<add name="UrlRoutingHandler" preCondition="integratedMode" verb="*" path="UrlRouting.axd" type="System.Web.Routing.UrlRoutingHandler, System.Web.Routing, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
</handlers>
</system.webServer>
<system.webServer>
<validation validateIntegratedModeConfiguration="false"/>
<modules runAllManagedModulesForAllRequests="true">
<remove name="ScriptModule"/>
<remove name="UrlRoutingModule"/>
<add name="ScriptModule" preCondition="managedHandler" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add name="UrlRoutingModule" type="System.Web.Routing.UrlRoutingModule, System.Web.Routing, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
</modules>
<handlers>
<remove name="WebServiceHandlerFactory-Integrated"/>
<remove name="ScriptHandlerFactory"/>
<remove name="ScriptHandlerFactoryAppServices"/>
<remove name="ScriptResource"/>
<remove name="MvcHttpHandler"/>
<remove name="UrlRoutingHandler"/>
<add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add name="MvcHttpHandler" preCondition="integratedMode" verb="*" path="*.mvc" type="System.Web.Mvc.MvcHttpHandler, System.Web.Mvc, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add name="UrlRoutingHandler" preCondition="integratedMode" verb="*" path="UrlRouting.axd" type="System.Web.HttpForbiddenHandler, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
</handlers>
</system.webServer>
</configuration>

0 comments on commit c2ab2f4

Please sign in to comment.