listings 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,9 +1,11 @@
1
- class ListingsController < ActionController::Base
2
- include ListingsHelper
1
+ module Listings
2
+ class ListingsController < ActionController::Base
3
+ include ActionViewExtensions
3
4
 
4
- def index
5
- listing = prepare_listing params, view_context
6
- render :partial => 'listings/index', :locals => { :listing => listing }
7
- end
5
+ def index
6
+ listing = prepare_listing params, view_context
7
+ render :partial => 'listings/index', :locals => { :listing => listing }
8
+ end
8
9
 
10
+ end
9
11
  end
data/config/routes.rb CHANGED
@@ -1,2 +1,3 @@
1
1
  Listings::Engine.routes.draw do
2
+ match 'listing/:listing' => 'listings#index'
2
3
  end
data/lib/listings/base.rb CHANGED
@@ -99,8 +99,9 @@ module Listings
99
99
  column.value_for(self, item)
100
100
  end
101
101
 
102
- def method_missing(m, *args, &block)
103
- view_context.send(m, *args, block)
102
+ def method_missing(m, *args, &block)
103
+ delegated_to = view_context.respond_to?(m) ? view_context : view_context.main_app
104
+ delegated_to.send(m, *args, block)
104
105
  end
105
106
  end
106
107
 
@@ -1,3 +1,3 @@
1
1
  module Listings
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: listings
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: