Permalink
Browse files

gemspec updated + use correct URL for path checking

Merges #56
  • Loading branch information...
1 parent 950344c commit 866346517fce7576204772737d0deac5698e6d15 Matthias Wagner committed with radar Apr 16, 2012
View
4 README.md
@@ -18,11 +18,11 @@ See the wiki for some more documentation on how you can use this extension.
## Basic Installation
-**For Spree 0.70.x**
+**For Spree 1.0.x**
1. Add the following to your Gemfile
<pre>
- gem 'spree_static_content', :git => 'http://github.com/spree/spree_static_content', :ref => '1861f4cd08c0ffa9940f0c81e69ea29b4541dbbd'
+ gem 'spree_static_content', :git => 'git@github.com:spree/spree_static_content.git', :branch => '1-0-stable'
</pre>
2. Run `bundle install`
3. To copy and apply migrations run: `rails g spree_static_content:install`
View
2 app/controllers/spree/static_content_controller.rb
@@ -15,7 +15,7 @@ def show
request.path
end
path = path.gsub('//','/')
- path = StaticPage::remove_spree_mount_point(path) unless Rails.application.routes.named_routes[:spree].path == "/"
+ path = StaticPage::remove_spree_mount_point(path) unless Rails.application.routes.url_helpers.spree_path == "/"
unless @page = Spree::Page.visible.find_by_slug(path)
render_404
View
2 app/views/spree/static_content/_static_content_list.html.erb
@@ -1,2 +1,2 @@
-<% page_uri = Rails.application.routes.named_routes[:spree].path == '/' ? page.slug : Rails.application.routes.named_routes[:spree].path + page.slug %>
+<% page_uri = Rails.application.routes.url_helpers.spree_path == '/' ? page.slug : Rails.application.routes.url_helpers.spree_path + page.slug %>
<li class=<%=(request.fullpath.gsub('//','/') == page_uri) ? 'current' : 'not'%>><%= link_to page.title, page_uri %></li>
View
2 config/routes.rb
@@ -1,6 +1,6 @@
module StaticPage
def self.remove_spree_mount_point(path)
- regex = Regexp.new Rails.application.routes.named_routes[:spree].path.spec.to_s
+ regex = Regexp.new Rails.application.routes.url_helpers.spree_path
path.sub( regex, '')
end
end
View
4 spree_static_content.gemspec
@@ -15,8 +15,8 @@ Gem::Specification.new do |s|
s.require_path = 'lib'
s.requirements << 'none'
- s.add_dependency 'spree_core', '~> 1.1.0.beta'
- s.add_dependency 'spree_auth', '~> 1.1.0.beta'
+ s.add_dependency 'spree_core', '~> 1.1.0'
+ s.add_dependency 'spree_auth', '~> 1.1.0'
s.add_development_dependency 'capybara', '1.0.1'
s.add_development_dependency 'factory_girl', '2.6.3'

0 comments on commit 8663465

Please sign in to comment.