{"id":22808367,"url":"https://github.com/sixarm/sixarm_rails_demo_devise","last_synced_at":"2026-05-16T17:05:57.776Z","repository":{"id":25832930,"uuid":"29272328","full_name":"SixArm/sixarm_rails_demo_devise","owner":"SixArm","description":"SixArm.com » Rails » Demo Devise","archived":false,"fork":false,"pushed_at":"2025-04-14T09:17:43.000Z","size":34,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2026-01-26T14:25:29.795Z","etag":null,"topics":["demo","devise","rails","ruby"],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SixArm.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2015-01-15T00:08:30.000Z","updated_at":"2025-04-14T09:17:47.000Z","dependencies_parsed_at":"2025-05-29T10:39:15.820Z","dependency_job_id":"362b32c4-fb48-46ed-95cf-9a057b9a6dbc","html_url":"https://github.com/SixArm/sixarm_rails_demo_devise","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/SixArm/sixarm_rails_demo_devise","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SixArm%2Fsixarm_rails_demo_devise","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SixArm%2Fsixarm_rails_demo_devise/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SixArm%2Fsixarm_rails_demo_devise/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SixArm%2Fsixarm_rails_demo_devise/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SixArm","download_url":"https://codeload.github.com/SixArm/sixarm_rails_demo_devise/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SixArm%2Fsixarm_rails_demo_devise/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33111498,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-16T04:41:52.686Z","status":"ssl_error","status_checked_at":"2026-05-16T04:41:52.009Z","response_time":115,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["demo","devise","rails","ruby"],"created_at":"2024-12-12T11:09:30.265Z","updated_at":"2026-05-16T17:05:57.741Z","avatar_url":"https://github.com/SixArm.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SixArm » Rails » \u003cbr\u003e Demo Devise authentication\n\nRails demonstration application that shows how to set up the Devise gem for user authentication.\n\n\n## Start\n\nCreate a new Rails application:\n\n```sh\nrails new demo_devise --database=postgresql --skip-bundle\ncd demo_devise\n```\n\nBundle:\n\n```sh\nbundle install --path vendor/bundle --binstubs vendor/bundle/binstubs\necho /vendor \u003e\u003e .gitignore\n```\n\nInitialize the database:\n\n```sh\nbin/rake db:create db:migrate\n```\n\nTest:\n\n```sh\nbin/rake test\n```\n\n\n## Launch\n\nStart the Rails server:\n\n```sh\nbin/rails server\n```\n\nBrowse \u003chttp://localhost:3000\u003e and you see the application running.\n\n\n## Home Page\n\nEdit `config/routes.rb` and change the root path to this:\n\n```ruby\nroot 'home#index'\n```\n\nGenerate:\n\n```sh\nbin/rails generate controller home index\n```\n\nBrowse \u003chttp://localhost:3000\u003e to see the new home page.\n\n\n## Messages\n\nEdit `app/views/layouts/application.html.erb` and insert these lines after the body tag:\n\n```erb\n\u003cbody\u003e\n  \u003cp class=\"notice\"\u003e\u003c%= notice %\u003e\u003c/p\u003e\n  \u003cp class=\"alert\"\u003e\u003c%= alert %\u003e\u003c/p\u003e\n```\n\n\n## Mailers\n\nEdit `config/environments/development.rb` and add this:\n\n```ruby\n# Set a default host that will be used in all mailers.\nconfig.action_mailer.default_url_options = { host: 'localhost', port: 3000 }\n```\n\nDo the same for `test.rb` and `production.rb` for now; you will need to change these later.\n\n\n## Generate User\n\nGenerate a user:\n\n```sh\nrails generate resource user name:string\nbin/rake db:migrate\n```\n\n\n## Devise\n\nEdit `Gemfile`:\n\n```ruby\n# Use Devise for user authentication\ngem 'devise'\n```\n\nBundle:\n```sh\nbundle\n```\n\nVerify `config/environments/development.rb` sets the mailer default, such as:\n\n```ruby\nconfig.action_mailer.default_url_options = { host: 'localhost', port: 3000 }\n```\n\nVerify `app/views/layouts/application.html.erb` shows messges, such as:\n\n```erb\n\u003cp class=\"notice\"\u003e\u003c%= notice %\u003e\u003c/p\u003e\n\u003cp class=\"alert\"\u003e\u003c%= alert %\u003e\u003c/p\u003e\n```\n\nVerify `config/routes.rb` has a root line, such as:\n\n```ruby\nroot 'home#index'\n```\n\nGenerate:\n\n```sh\nrails generate devise:install\nrails generate devise user\nbin/rake db:migrate\n```\n\nEdit `test/fixtures/users.yml` and add a unique email address to each user:\n\n```yaml\none:\n  name: MyString\n  email: user1@example.com\ntwo:\n  name: MyString\n  email: user2@example.com\n```\n\n\n## Devise upgrades\n\nDevise upgrades the application and user model with these capabilities:\n\n  * email\n  * encrypted password\n  * sign in tracking\n  * confirmable accounts\n  * lockable accounts\n\nThe `db/schema.rb` users section looks like this:\n\n```ruby\ncreate_table \"users\", force: :cascade do |t|\n  t.string   \"name\"\n  t.datetime \"created_at\",                          null: false\n  t.datetime \"updated_at\",                          null: false\n  t.string   \"email\",                  default: \"\", null: false\n  t.string   \"encrypted_password\",     default: \"\", null: false\n  t.string   \"reset_password_token\"\n  t.datetime \"reset_password_sent_at\"\n  t.datetime \"remember_created_at\"\n  t.integer  \"sign_in_count\",          default: 0,  null: false\n  t.datetime \"current_sign_in_at\"\n  t.datetime \"last_sign_in_at\"\n  t.inet     \"current_sign_in_ip\"\n  t.inet     \"last_sign_in_ip\"\nend\n\nadd_index \"users\", [\"email\"], name: \"index_users_on_email\", unique: true, using: :btree\nadd_index \"users\", [\"reset_password_token\"], name: \"index_users_on_reset_password_token\", unique: true, using: :btree\n```\n\n\n## Devise authentication\n\nEdit `app/controllers/home_controller.rb` and add authentication:\n\n```ruby\nclass HomeController \u003c ApplicationController\n  before_action :authenticate_user!\n```\n\nBrowse \u003chttp://localhost:3000/\u003e and you now see the Devise sign in page.\n\nThe page says \"You need to sign in or sign up before continuing.\"\n\n\n## Devise sign up\n\nSign up:\n\n  * Email: `alice@example.com`\n  * Password: `secretive`\n\nYou should see: \"Welcome! You have signed up successfully.\"\n\nTo see the new user record in Rails:\n\n```sh\nbin/rails console\n```\n\n```irb\n\u003e User.first.email\n  User Load (0.7ms)  SELECT  \"users\".* FROM \"users\"  ORDER BY \"users\".\"id\" ASC LIMIT 1\n=\u003e \"alice@example.com\"\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsixarm%2Fsixarm_rails_demo_devise","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsixarm%2Fsixarm_rails_demo_devise","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsixarm%2Fsixarm_rails_demo_devise/lists"}