A Ruby on Rails Journey

October 6, 2011

Nifty Authentication

Filed under: survivor — Dick @ 9:14 pm

For my survivor pool app, I need users. I’ll use nifty-generators nifty:authentication to do it. First I type

rails g nifty:authentication --help

to figure out what’s what. It recommends that I install nifty:layout first, so I do.

rails g nifty:layout

It asked me if I wanted to overwrite application.html.erb and I said “Y”. Next I install authentication

rails g nifty:authentication

When I try to start the server, it complains that I don’t have the mocha gem. Oh yeah, I probably need to do some stuff first.

bundle install
rake db:migrate

Now I can start the server and navigate to http://localhost:3000/signup and it works a treat. Before I push these changes up to heroku, I want to make a landing page so it’s not the rails default one. For now, I delete public/index.html and put

root :to => "users#new"

in config/routes.rb. The landing page will be the signup page for now. Next, push it up to heroku

git push heroku master
heroku rake db:migrate

Ugh. Heroku uses postgres and my Rails app is in sqlite3. I’ll post how I fix it, but I’ll bet it won’t be pretty

Advertisement

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Theme: Silver is the New Black. Blog at WordPress.com.

Follow

Get every new post delivered to your Inbox.