Closed joshsmith closed 11 years ago
Can you share your Gemfile and and routes file?
Hi,
Same issue, my Gemfile :
source 'https://rubygems.org'
gem 'rails', '4.0.0'
gem 'haml'
gem 'sass-rails', '~> 4.0.0'
gem 'bootstrap-sass', :git => 'git://github.com/thomas-mcdonald/bootstrap-sass.git', :branch => '3'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.0.0'
gem 'jquery-rails'
gem 'turbolinks'
gem 'jbuilder', '~> 1.2'
gem 'griddler'
group :development do
gem 'sqlite3'
end
group :development, :test do
gem 'rspec-rails', '~> 2.0'
end
group :test do
gem 'factory_girl'
end
My routes.rb file :
Myapp::Application.routes.draw do
mount_griddler
match '(:locale)', to: 'posts#index', via: [:get, :post]
scope ':locale', :constraints => { :locale => /fr/ } do
resources :posts
root to: 'posts#index'
end
end
Cheers, Julien.
The mount_griddler
helper is not in the released version of Griddler.
@jlerpscher are you also seeing the Invalid route name
error with the post '/email_processor' => 'griddler/emails#create'
line?
@JoshSmith it sounds like you have another route defined called email_processor
. Check your config/routes.rb
for that name, or as @theycallmeswift suggested you can post your routes and we'll take a look.
Thank you for your reply,
If I use this line, I have the following error:
Invalid route name, already in use: 'email_processor' (ArgumentError)
You may have defined two routes with the same name using the `:as` option, or you may be overriding a route already defined by a resource with the same naming. For the latter, you can restrict the routes created with `resources` as explained here
Can you paste the output of rake routes | grep email_processor
, or let us know if there isn't any output?
I'm also wondering if this is some sort of double-require issue. What happens if the griddler change is the last line in routes.rb
?
Here is the output of rake routes (before trying to add the griddler route):
email_processor POST /email_processor(.:format) griddler/emails#create
Putting the route at the bottom of routes.rb
doesn't change anything.
Ah, so the problem is that, in the released version of Griddler, we had already defined the route.
If /email_processor works for you, there is no need to add it to routes.rb
. If not, please use the github version of Griddler until we cut a release: gem 'griddler', github: 'thoughtbot/griddler'
and you can defined it wherever you'd like:
post '/your/favorite/path' => 'griddler/emails#create', as: :email_processor
Sorry about that, totally our fault.
No problem, I will use the Github version until next release!
Thanks for this awesome gem :)
I just pushed a new version. Let us know if you run into any more issues, and thanks for working with us to troubleshoot.
When I use
post '/email_processor' => 'griddler/emails#create'
, I get the following error:When I use the route helper
mount_griddler
without any arguments, I get this error:Clearly not desired behavior, but not really sure why this might be happening. Any thoughts?