I’m following this tutorial:
http://railstutorial.org/chapters/filling-in-the-layout#sec:layout_links
When I try to visit http://localhost:3000/pages/home for example, I get
No route matches “/pages/home”
What is the problem in my routes.rb file. You can find this file as an
attachment.
Thanks.
On 8 August 2010 22:01, Abder-Rahman A. [email protected] wrote:
Attachments:
http://www.ruby-forum.com/attachment/4927/routes.rb
The problem is exactly what it says: there’s no route for ‘pages/home’
in that routes.rb.
You can add one with:
match ‘pages/home’ => ‘pages#home’
or, if you want to match all actions in PagesController under a
similar URL scheme, you could do something like:
match ‘pages/:action’, :controller => ‘pages’
Was there a line already in your routes.rb that you thought would
match this URL? If so, let us know, as we might be able to point you
towards a better understanding of the route mapping system.
Chris
Chris M. wrote:
On 8 August 2010 22:01, Abder-Rahman A. [email protected] wrote:
Attachments:
http://www.ruby-forum.com/attachment/4927/routes.rb
The problem is exactly what it says: there’s no route for ‘pages/home’
in that routes.rb.
You can add one with:
match ‘pages/home’ => ‘pages#home’
or, if you want to match all actions in PagesController under a
similar URL scheme, you could do something like:
match ‘pages/:action’, :controller => ‘pages’
Was there a line already in your routes.rb that you thought would
match this URL? If so, let us know, as we might be able to point you
towards a better understanding of the route mapping system.
Chris
Thanks Chris. I tried to make the application from scratch again, and
notices that I get the following when I run: $ rake db:migrate
(in /Users/abder/Desktop/Rails/auth)
== DeviseCreateUsers: migrating
– create_table(:users)
rake aborted!
An error has occurred, this and all later migrations canceled:
undefined method `registerable’ for
#ActiveRecord::ConnectionAdapters::TableDefinition:0x1b2c8c4
(See full trace by running task with --trace)
Provided that “user.rb” and the migration files are as shown in the
attachment.
Thanks.
I have to REMOVE (Comment out) the following from the migration file for
the $ rake db:migrate to work:
t.registerable
t.validatable
Is that anything to do with Rails3.0.0.rc which I’m using?
I tried to create the application from scratch once more and it worked
WITHOUT removing anything.
I think in the preceding one that didn’t work I had an issue with: $
rails generate devise:install
Although I ran this command but at at late point. I don’t know if the
ordering if this command matters especially before creating the devise
model?
I have to REMOVE (Comment out) the following from the migration file for
the $ rake db:migrate to work:
t.registerable
t.validatable
Is that anything to do with Rails3.0.0.rc which I’m using?
The 1.1 branch of devise doesn’t have those strategies as far as I’m
aware.
Here’s the github page: GitHub - heartcombo/devise: Flexible authentication solution for Rails with Warden.
What I’m seeing in terms of AR migration strategies on the 1.1 branch
are
the following:
t.database_authenticatable
t.recoverable
t.renemberable
t.trackable
t.confirmable
t.lockable
t.token_authenticatable
Whatever guide you are following might be using the 1.0.X branch of
devise
which is intended for rails 2.3.2+. There have been some relatively
large
changes between the 1.0.X branch and the 1.1.X branch.
-Patrick R.