Learn Ruby On Rails For Web Development: Learn Rails The Fast And Easy Way by John Elder

Learn Ruby On Rails For Web Development: Learn Rails The Fast And Easy Way by John Elder

Author:John Elder [Elder, John]
Language: eng
Format: epub
Publisher: Codemy.com
Published: 2015-01-18T22:00:00+00:00


The only thing left to do is add the command from step five into the terminal, so let's go ahead and do that now:

1 $ rails g devise:views

2

This runs the generator for the devise views. Notice in the past we've always written out generate commands, like this:

1 $ rails generate devise:views

2

Just typing "g" instead of generate is shorthand and completely acceptable.

After you run this command, check out your /app/views/ directory. You should see a new folder named "devise". That folder contains a bunch of folders and all the new pages that Devise has automatically created to handle stuff like logging in, logging out, editing user profiles, resetting passwords, and stuff like that. Check it out!

The terminal should have displayed a bunch of text too...that's a breakdown of what Devise just added. So you can eyeball it. See all those pages? For instance, let's look at /app/views/devise/registrations/new.html.erb

I'm guessing that's the page that allows people to register for your site (create a 'new' registration). Open it in the text editor and you'll see a "Sign Up" tag right at the top of the file.

How about: app/views/devise/sessions/new.html.erb? That's the page that allows people to log in. When someone logs into your web site they are essentially creating a session. Logging in is the act of creating a new session.

Similarly, logging out is the act of deleting a session.

Devise has created a BUNCH of stuff, and to tell you the truth, we aren't even going to use most of it. So don't get overwhelmed.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.