install-devise#
Install and Initialise#
include 'Gemfile' / gem 'devise'
bundle install
rails g devise:install
rails g devise user -> gen 'User' table
> config/initializers/devise.rb
Tools#
curl#
CURL COMMANDS:
// For creating a user:
curl -i -H "Accept: application/vnd.api+json" -H 'Content-Type:application/vnd.api+json' -X POST -d '{"data": {"type":"users", "attributes":{"name":"Consuela"}}}' http://localhost:3000/users
// For creating a post that belongs to contact with id of 1:
curl -i -H "Accept: application/vnd.api+json" -H 'Content-Type:application/vnd.api+json' -X POST -d '{ "data": { "type": "posts", "relationships": { "user": { "data": { "type": "users", "id": "1" } } }, "attributes": { "title": "Laughter Post", "content": "HAHAHA" } } }' http://localhost:3000/posts
put this into correct sequence#
rails g devise:install
> create config/initializers/devise.rb
> create config/locales/devise.en.yml
and, also creat the views, gives the following end points
rails g devise:views
invoke Devise::Generators::SharedViewsGenerator
create app/views/devise/shared
create app/views/devise/shared/_error_messages.html.erb
create app/views/devise/shared/_links.html.erb
invoke form_for
create app/views/devise/confirmations
create app/views/devise/confirmations/new.html.erb
create app/views/devise/passwords
create app/views/devise/passwords/edit.html.erb
create app/views/devise/passwords/new.html.erb
create app/views/devise/registrations
create app/views/devise/registrations/edit.html.erb
create app/views/devise/registrations/new.html.erb
create app/views/devise/sessions
create app/views/devise/sessions/new.html.erb
create app/views/devise/unlocks
create app/views/devise/unlocks/new.html.erb
invoke erb
create app/views/devise/mailer
create app/views/devise/mailer/confirmation_instructions.html.erb
create app/views/devise/mailer/email_changed.html.erb
create app/views/devise/mailer/password_change.html.erb
create app/views/devise/mailer/reset_password_instructions.html.erb
create app/views/devise/mailer/unlock_instructions.html.erb