Skip to content

Instantly share code, notes, and snippets.

@ptsurbeleu
ptsurbeleu / rails_load_path_tips.md
Created January 19, 2017 01:16 — forked from maxim/rails_load_path_tips.md
How to use rails load paths, app, and lib directories.

In Rails 3

NOTE: This post now lives (and kept up to date) on my blog: http://hakunin.com/rails3-load-paths

If you add a dir directly under app/

Do nothing. All files in this dir are eager loaded in production and lazy loaded in development by default.

If you add a dir under app/something/

@ptsurbeleu
ptsurbeleu / HomeController.cs
Last active December 14, 2015 18:09 — forked from johnnyreilly/DemoAreaRegistration.cs
This is a forked version of John Reilly's gist that has been specifically tailored to bring testability for one of the Controller.Url.RouteUrl overloads. See below some code as an example of how this could done. P.S. Some features has been cut off from the original gist.
using System.Collections.Generic;
using System.Linq;
using System.Web.Mvc;
namespace DemoApp.Controllers
{
public class HomeController : System.Web.Mvc.Controller
{
//....
public ActionResult About()