You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
cclausen edited this page Jan 9, 2013
·
1 revision
#
# Example Controller for Magic Rails methods and our helpers
#
class MagicController < InheritedResources::Base
respond_to :json, :xml
has_pagination
has_scope :search
load_and_authorize_resource :except => [:index, :show]
def index
super do |format|
format.html do
@search = params[:search]
@search = nil if @search.blank?
end
end
end
def create
@version = build_resource.versions.first
@version.user = current_user
super
end
end