Module Lightrail::ControllerMethods::ClassMethods
In: lib/lightrail/controller_methods.rb

Methods

lightrail  

Public Instance methods

To make a controller a lightrail controller, add the following code to the controller:

  include Lightrail::ControllerMethods
  lightrail(File.expand_path(File.join(__FILE__,"../","../","../","views")))

filename: The filename of the controller

Designed to only use the following publicly exposed methods of the rails api

  • view_paths
  • around_filter

Important Security Information

If you add a route that maps explicity to the base class, the controller will render If you do not add an explicit route, it will not render (as of Rails 2.0.2) If you need to restrict access to these controllers make sure that you:

  • have your plugin‘s controllers inherit from a secure controller (like one of your admin controllers)
  • write specs to ensure that these routes are inaccessible

This has not been tested thoroughly, and may be quite hackable

TODO: figure out how to call another file‘s FILE parameter, so we can get this dynamically TODO: figure out how to make it impossible to render these actions to the public

[Validate]