RailsCasts Pro episodes are now free!

Learn more or hide this

Ty Barho's Profile

GitHub User: tbarho

Site: tybarho.com

Comments by Ty Barho


The best way i've found to do this is to just add a route in your routes file like:

match '/editor(/*requested_uri)' => 'mercury_auth#edit', :as => :mercury_editor

Then create a new controller that inherits from MercuryController, like:

class MercuryAuthController < MercuryController
  include SessionsHelper

  before_filter :authenticate_with_admin, :only => [:edit]
  def edit
    render :text => '', :layout => 'mercury'

Then, you can get all the functionality of Mercury, but limit access on requests like that. That might be a bit closer to what you were looking for.

Oh, and be sure to add that route before the mercury routes in your routes.rb file