title: Orchard CMS rendering parts outside of admin section
body: <p>I am working on a module by following the instructions here <a href="http://orchardproject.net/docs/Creating-a-module-with-a-simple-text-editor.ashx" rel="nofollow">http://orchardproject.net/docs/Creating-a-module-with-a-simple-text-editor.ashx</a> </p>
  
  <p>The one change I want to do is, rendering the product creation outside of admin module. So I created homecontroller like this</p>
  
  <pre><code>public class HomeController : Controller
  {
  
      public HomeController(IContentManager cm) {
          ContentManager = cm;
      }
  
      private IContentManager ContentManager { get; set; }
  
  
  
   public ActionResult Index() {
          return Content("This is index");
  
      }        [Themed]
      public ActionResult Create()
      {
          var product = ContentManager.New("Product");
          var model = ContentManager.BuildEditor(product);
          return View((object) model);
  
      }
  </code></pre>
  
  <p>and a file routes.cs in the root folder</p>
  
  <pre><code>public class Routes : IRouteProvider
  {
      public void GetRoutes(ICollection&lt;RouteDescriptor&gt; routes)
      {
          foreach (var routeDescriptor in GetRoutes())
              routes.Add(routeDescriptor);
      }
  
      public IEnumerable&lt;RouteDescriptor&gt; GetRoutes()
      {
          return new[] {
              new RouteDescriptor {
                  Priority = 5,
                  Route = new Route(
                      "commerce",
                      new RouteValueDictionary {
                          {"area", "SimpleCommerce"},
                          {"controller", "Home"},
                          {"action", "Index"}
                      },
                      new RouteValueDictionary(),
                      new RouteValueDictionary {
                          {"area", "SimpleCommerce"}
                      },
                      new MvcRouteHandler())
              },
              new RouteDescriptor {
                  Priority = 6,
                  Route = new Route(
                      "commerce/Create",
                      new RouteValueDictionary {
                          {"area", "SimpleCommerce"},
                          {"controller", "Home"},
                          {"action", "Create"}
                      },
                      new RouteValueDictionary(),
                      new RouteValueDictionary {
                          {"area", "SimpleCommerce"}
                      },
                      new MvcRouteHandler())
              }
  
          };
      }
  }
  </code></pre>
  
  <p>So how should I move from here onwards to render this whole thing together when I navigate to url <a href="http://localhost:35713/commerce/create" rel="nofollow">http://localhost:35713/commerce/create</a></p>
  
  <p>But it throws an error saying create view didnt find. Then I created a view (create.cshtml) in Views/Home folder</p>
  
  <pre><code>@model SimpleCommerce.Models.ProductPart
  &lt;fieldset&gt;
      &lt;label class="sub" for="Sku"&gt;@T("Sku")&lt;/label&gt;&lt;br /&gt;
      @Html.TextBoxFor(m =&gt; m.Sku, new { @class = "text" })&lt;br /&gt;
      &lt;label class="sub" for="Price"&gt;@T("Price")&lt;/label&gt;&lt;br /&gt;
      @Html.TextBoxFor(m =&gt; m.Price, new { @class = "text" })
  &lt;/fieldset&gt;
  </code></pre>
  
  <p>Now it throws an error saying</p>
  
  <blockquote>
    <p>The model item passed into the dictionary is of type 'IShapeProxyedcfa08c61cf49898dc2e77bde025039', but this dictionary requires a model item of type 'SimpleCommerce.Models.ProductPart'.</p>
  </blockquote>