Created
September 9, 2011 10:00
-
-
Save Marchino/1205870 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Mmplus | |
module Controllers | |
module Items | |
extend ActiveSupport::Concern | |
included do | |
before_filter :set_instance | |
def index | |
do_search(params[:search] || {}, @instance) | |
end | |
def show | |
@item = @instance.find(params[:id]) | |
@shipping_costs = load_shipping_costs(@item, params[:country] || session[:user_data][:country]) | |
@mlt = @item.more_like_this do | |
fields :title_it, :title_en, :author, :subjects_it, :subjects_en | |
paginate(:page => 1, :per_page => 5) | |
end | |
end | |
private | |
def set_instance | |
@instance = self.controller_name.singularize.camelize.constantize | |
end | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment