並び順

ブックマーク数

期間指定

  • から
  • まで

321 - 360 件 / 510件

新着順 人気順

deviseの検索結果321 - 360 件 / 510件

  • 新しいRailsプロジェクトを作成してdeviseを実装する

    こんにちは。 GMOアドマーケティング18新卒のR.Sです。 前回のブログでは新卒研修の内容を紹介しました。 Ruby on Railsの知識をさらに深めるために、基本になりそうな「devise」というgemを使ってみたので、今回はアプリケーションを作る第一歩となる「rails new」から「devise」の実装までを紹介します。 deviseとは、ユーザー登録やログイン、パスワードの再発行、アカウントロックなどの機能を簡単に実装できるgemです。 環境構築 Railsでの開発環境を整え、新しいプロジェクトを作ります。 参考にしたページは「新規Railsプロジェクトの作成手順まとめ」です。 プロジェクトごとにRubyのバージョンが違ったり、使うgemが違ったりするので、他のプロジェクトやシステムの環境に影響を与えずに新プロジェクトを作りたい人向けです。基本的にはこのページの通りに進めていき

      新しいRailsプロジェクトを作成してdeviseを実装する
    • Rails devise で複数モデルの認証機能を実装 | PbTimes 情報誌

      Rails devise で複数モデルを管理 概要 rails のログイン認証 Gem「devise」のインストール・設定方法を紹介します。 よく「device」とtypoしてる人を見かけますので、間違えないよう注意してください。 今回は、member/・admin/とモジュール分けし、それぞれの認証機能を設置しています。 gem インストール Gemfile に以下を追加します。 gem 'devise' bundle install 実行 $ bundle install devise インストール $ rails g devise:install 設定ファイルを変更 (/config/initializers/devise.rb) config.scoped_views = true devise 設定 user、adminモデルを追加 $ rails g devise user $

        Rails devise で複数モデルの認証機能を実装 | PbTimes 情報誌
      • How To: Upgrade to Devise 2.0 migration schema style

        Devise 2.0 no longer includes helpers for your migrations (even for your old migrations creating tables used in versions prior to 2.0). Instead, we simply list the database fields explicitly. This page shows the before and after of your original Devise migration(s) so you can easily compare and update your code. Meaning: You will need to change your original Devise migration(s) to not use the Befo

          How To: Upgrade to Devise 2.0 migration schema style
        • Railsの認証Gem、Deviseとはなんなのか - あすたぴのブログ

          目的 deivseについての理解を深めて、デフォルト動作ではない認証を作れるようにする。 背景 用意されすぎているライブラリは苦手。 挙動を変えたい場合に出来ること、出来ないことがわかりにくい。 理解したいってこと。 deviseとは RailsEngineで作られている、Railsの認証ライブラリ。 サクっと認証を用意できる。ために、色々とデフォルト動作が決まっている。 手厚いサポート(機能)があるが、実際そんなにいらないことも多いはず。 ただ、有名すぎてこれを使っちゃうだろう。 wardenをみたあとでは、別にwardenでもいいよね。って気持ちはある。 だがデフォルトの動作を理解し自分の必要な部分だけを残し、ほかはいい感じにカスタマイズが出来るのであれが、deviseを使ったほうが楽だろうなというところ。 それが可能か検証する。 defaultで含まれているモジュール Databas

            Railsの認証Gem、Deviseとはなんなのか - あすたぴのブログ
          • Rails & Devise: How to render login page without a layout?

            I know this is probably a simple question, but I'm still trying to figure Devise out... I want to render :layout => false on my login page; how can I do this with Devise?

              Rails & Devise: How to render login page without a layout?
            • HTTP authentication between devise and iphone app

              I'm new to ruby on rails but I want to send the data from my SQlite database from my iphone app to the rails web app. Like a "sync" service. I'm using devise for authentication for the web app. I enabled basic HTTP authentication and I can curl into the website for xml or json data. I can also upload data to the website when I set the post headers to JSON and with username and password. Here's whe

                HTTP authentication between devise and iphone app
              • Rails4でActiveAdminとdeviseとcancancanをつかって管理者ページを作る - memo-mode

                環境 Rails 4.1.2 ruby 2.1.1 devise 3.3.0 active_admin 1.0.0 pre cancancan 1.9.2 Gemfile gem 'rails', '4.1.2' gem 'cancancan' gem 'devise' gem 'activeadmin', github: 'activeadmin' bundleする $ bundle install まずはdeviseでモデルを作る. roleでadminかどうかを判定するのでUserコントローラに追加 $ rails generate devise:install $ rails generate devise User $ rails generate migration add_role_to_users role:integer $ rake db:migrate Deviseの

                  Rails4でActiveAdminとdeviseとcancancanをつかって管理者ページを作る - memo-mode
                • How To: Upgrade to Devise 2.0

                  Devise 2.0 is actually a small release aimed mainly to clean up Devise source code. With time, Devise added new behaviors but, since we had to maintain backwards compatibility, we could not deprecate the old behaviors. Devise 2.0 finally deprecates such old behaviors. The difficulty to migrate to Devise 2.0 will depend on when you started developing your application. If you started a long time ago

                    How To: Upgrade to Devise 2.0
                  • Silicon Valley Bosses Are Huddling Tuesday to Devise a Response to the Immigration Ban

                    Silicon Valley Bosses Are Huddling Tuesday to Devise a Response to the Immigration Ban A group of technology companies plans to meet on Tuesday to discuss filing an amicus brief in support of a lawsuit challenging U.S. President Donald Trump’s order restricting immigration from seven Muslim-majority countries, said a spokesperson for a company organizing the gathering. The meeting is being called

                      Silicon Valley Bosses Are Huddling Tuesday to Devise a Response to the Immigration Ban
                    • Adding custom fields to your Devise User model in Rails 4 | 12 Spokes

                      Jun 21, 2013 Adding custom fields to your Devise User model in Rails 4 Jeff Mueller How-to, Ruby on Rails, Web Design & Development 12 So, you’ve set up a new Rails 4.0.0rc2 project with Devise 3.0.0.rc. Look at you, cutting-edge-developer-person! You’ve set up a user model, you can register, you can log in, you can log out. Awesome. But now you want to add some additional columns to your user mod

                      • Deviseのconfirmableでメール認証を後回しにする - Qiita

                        やりたいこと deviseでconfirmableを有効にしてる場合、会員登録のフローでメールアドレスの確認が必要で面倒。 会員登録時のメール認証は省いて後から認証を行ってもらう形を取りたい。 confirmableモジュール confirmableモジュールの中で認証系を扱っているのは下記のコード。

                          Deviseのconfirmableでメール認証を後回しにする - Qiita
                        • deviseで複数モデル対応とRspecでのテスト – 地方でリモートワーク

                          deviseで複数モデル対応とRspecのテストの方法です。 スペルミスでテストが通らなくて、4時間くらいはまってました。みなさんもスペルミスには気を付けましょう。 かなり調べたので勉強にはなりましたが…。 configにコードを追加 $ rails g devise:isntall これでconfig/initializers配下にdevise.rbが生成される。以下のコードのコメントアウトを外します。 config/initializers/devise.rb config.scoped_views = true deviseと関連したmodelを生成する 今回はadminとuserで生成したいと思います。既存のmodelも上書き可能です。 $ rails g devise user $ rails g devise admin 各modelに対応するcontrollerの生成 各mo

                          • How to post a message to the Facebook wall with OmniAuth/Devise

                            In your [OmniAuth/Devise-callback controller](http://railscasts.com/episodes/235-omniauth-part-1) add this line: ```ruby # https://github.com/intridea/omniauth/wiki/Auth-Hash-Schema session['fb_access_token'] = omniauth['credentials']['token'] ``` This will save the auth\_token, which we’ll need for accessing the Facebook API. Next, in your Devise initializer, usually config/initializer/devise.rb,

                            • ActionCableでDeviseのcurrent_userを扱う - Qiita

                              【注意!】この記事はRails 5.0.0RC1を対象にしています。他のバージョンでの挙動は分かりません。あとそのうちDevise側が対応してくると思います。 (3.5では未対応) Rails 5の目玉機能といえば、ActiveCable。実際に使うとなるとDeviseなどの認証機構と一緒に使うと思います。 しかし、ActionCable + Deviseをググってもあまり良い情報は出てこず、ログインしたらcookieにcurrent_user.idを書くと良いよという記事が真っ先に出てきます。 そんな雑な方法はイヤなので、sessionから読むようにしてみます。 module ApplicationCable class Connection < ActionCable::Connection::Base identified_by :current_user def connect s

                                ActionCableでDeviseのcurrent_userを扱う - Qiita
                              • Remote authentication with devise - 4Trabes

                                Trabe ya no escribe aquí. Puedes encontrarnos en nuestra publicación en Medium: medium.com/trabe. Devise is great. It simplifies lots of tasks related to resource management: authentication, registration, confirmation, etc; and it does it in a clean and highly configurable way. But it is only this great if you are managing your resources locally. Devise has adapters only for models backed up with

                                • devise « Plataformatec Blog

                                  Posts tagged "devise" Devise version 4.7.1 was released with a fix for an edge case that could confirm accounts by mistake. We’ll explain now in details what is the issue, how it was fixed and which actions you might want to take in your applications. Description We received a security report saying that it was possible to confirm … » Tags: devise, rails, Posted in English, Comments Off on Improve

                                  • 【deviseに疲れた人のための】sorceryでユーザログイン機能を実装 - 珈琲駆動開発

                                    deviseの代替案として、前々からsoceryいいよなんてきいてたので使ってみます。 github.com @komagata さんにおききしたらつらみはそんなに減らないとなったのが一瞬頭によぎる @komagata devise、つらみを感じてます...。あとはSorceryとかをよくきくのですがどうなのですかね?— 凸(とつ) Totz Yuta (@totzyuta) December 5, 2015 @totzyuta sorceryもそれほどつらみが減ってない感じしてます。monbanが気になってますがstarが少なくて怖いです… https://t.co/trOLzHtXWh— Masaki Komagata (@komagata) December 5, 2015 まぁ…使ってみないことには分からないのでやってみましょう。monbanも気になるところですが。 Special

                                      【deviseに疲れた人のための】sorceryでユーザログイン機能を実装 - 珈琲駆動開発
                                    • Deviseとsimple_formで会員登録するときの利用規約への同意確認 - 考えまとめノート

                                      よくある利用規約に同意するかどうかチェック入れてから次に進むやつです。 意外と手間取ったので書き残しておきます。 STEP1 model まずmodelにvalidates_acceptance_ofを追記。 agreementというひねりの無い名前を付けてみました。 # user.rb attr_accessible :agreement # 利用規約への同意フラグ(カラムなし) validates_acceptance_of :agreement, allow_nil: false, message: "※会員登録には利用規約への同意が必要です。", on: :create STEP2 view つぎにviewに同意するチェックボックスを付けます。 (terms_pathはこのサイトの利用規約ページへのリンクです。適当に読み替えてください。) # registrations/new.h

                                        Deviseとsimple_formで会員登録するときの利用規約への同意確認 - 考えまとめノート
                                      • Rails2.3.11 + devise1.0.11 で JSONでログインしてみる

                                        今回の記事はRails3には多分関係ないお話になるでござる。 デフォでJSONでのログイン対応しているみたいだから。 前回の記事 でJSONを使ってやりとりするのは試してみたけど そもそもそれに使うauth_tokenを script/console(Rails3なら rails console かな?)から取得するというズルをしていたので、 今度はログイン時にauth_tokenを取得できるようにしてやろうという目論見。 なんだけどdevise-1.0.11はデフォルトではJSONやXMLを使ってのやりとりに対応してない。 $ rake routes|grep sign new_user_session GET /accounts/sign_in {:action=>"new", :controller=>"sessions"} user_session POST /accounts/s

                                          Rails2.3.11 + devise1.0.11 で JSONでログインしてみる
                                        • Rails3+deviseで不要なアクションへのroutesを無効にする

                                          Rails3時代の認証システムはRestful Authenticationからdeviseに変わったみたいですが、このdeviseという認証システムには以下のような非常に豊富な機能が付いており、殆どのアプリケーションに対してオーバースペックな気がします。 Sign inSign outRegistrationConfirmationForget passwordLock/Unlock accountとはいえ、わざわざDeviseのControllerをオーバーライドして不要なアクションを削除したりするのはとてもメンドクサイので、Routingを編集することで当該機能にアクセスできないようにしちゃます。 deviseのroutesを定義しているdevise_forメソッドは、resourcesに使うような標準オプションも受け入れてくれるので以下のようにすればOKです。 # RAILS_RO

                                            Rails3+deviseで不要なアクションへのroutesを無効にする
                                          • rdoc.info :: devise

                                            A ActiveRecord Authenticatable (Devise::Strategies) Authenticatable (Devise::Models) B Base (Devise::Strategies) C ClassMethods (Devise::Models::Validatable) ClassMethods (Devise::Models::Registerable) ClassMethods (Devise::Models::Confirmable) ClassMethods (Devise::Controllers::Helpers) ClassMethods (Devise::Controllers::ScopedViews) ClassMethods (Devise::Models::Lockable) ClassMethods (Devise::M

                                            • [Rails] Devise (2.0.4)でDEPRECATION WARNINGが発生 | CreativeStyle

                                              警告ネタが続きますが、どこかの誰かの役に立つかもとしれないということで。 Railsに便利な認証機能を追加してくれるプラグイン「Devise」を使っていたら「DEPRECATION WARNING」が発生したので、その時の対応についてメモ。 当方の環境はRails 3.2.1 + Devise 2.0.4。 以下が発生した警告。 DEPRECATION WARNING: Passing a block to devise_for is deprecated. Please remove the block from devise_for (only the block, the call to devise_for must still exist) and call devise_scope :user do ... end with the block instead. DEPRECA

                                                [Rails] Devise (2.0.4)でDEPRECATION WARNINGが発生 | CreativeStyle
                                              • deviseのRails4.0.0対応に関して - Qiita

                                                deviseのRails4.0.0対応状況 devise使ってますか?Rails4.0使ってますか? ということでdevise使っててRails4.0で試そうとしたら、色々とうまくいかない!と困ってました。strong_parameter系ですね。 今までだと、各種コントローラーを継承したカスタムコントローラーでbuild_resourceをoverridesしてたんですが、4月中旬にやっとstrong_parameter対応のブランチがRails4ブランチにマージされました。 (masterブランチではないので注意) ということで、導入は簡単になりました。 Railsへのrails4ブランチの導入 Gemfileはこう書けばいいですね。

                                                  deviseのRails4.0.0対応に関して - Qiita
                                                • Rails tips: DeviseとOmniAuth認証でLinkedIn機能にサインインする(翻訳)|TechRacho by BPS株式会社

                                                  本記事ではRuby 2.5 + Rails 5.1.4を用います。執筆時点ではいずれも最新です。まずはGemfileにDevise gemを追加しましょう。 gem 'devise' 続いてbundle installを実行してPCにgemをインストールしなければなりません。しかしインストールはこれだけでは終わりません。以下のコマンドを実行して、Deviseのイニシャライザファイルと翻訳ファイルを生成しなければなりません。 rails generate devise:install モデルの生成 これでモデルを生成できるようになりました。認証データを持つモデル名はUserとするのが普通なので、この名前にします。 rails generate devise user 上のコマンドでDeviseがモデルのクラスとマイグレーションとカラのテストを生成してくれます。Userモデルの内容は次のように

                                                    Rails tips: DeviseとOmniAuth認証でLinkedIn機能にサインインする(翻訳)|TechRacho by BPS株式会社
                                                  • How to do integration testing with RSpec and Devise/CanCan?

                                                    If I have a Devise model User, of which only those users with role :admin are allowed to view a certain url, how can I write an RSpec integration test to check that the status returns 200 for that url? def login(user) post user_session_path, :email => user.email, :password => 'password' end This was pseudo-suggested in the answer to this question: Stubbing authentication in request spec, but I can

                                                      How to do integration testing with RSpec and Devise/CanCan?
                                                    • Testing (RSpec) with Devise's confirmable module

                                                      It's my understanding that Rails' testing environment is torn down and rebuilt before each test...so how do I test a controller that requires that a user be logged in and that user can't be created without Device's confirmable module getting in the way? Devise's recommended method (below) creates a new user which is then sent an email by Devise's confirmable module. How do I get around this so I'm

                                                        Testing (RSpec) with Devise's confirmable module
                                                      • railsの日本語化 deviseの日本語化 - Qiita

                                                        github https://gist.github.com/yhara/606476 から devise.ja.ymlをダウンロードし、/config/localesに入れる。 追記: 以下のURL内のdevise.ja.ymlのほうが良かった。 http://qiita.com/MasatoYoshioka@github/items/8d910e793e7c485403bb deviseのエラーメッセージのカスタマイズ railsでdeviseプラグイン使用時、エラーメッセージを日本語化する http://gaku3601.hatenablog.com/entry/2014/10/04/185947 を参考にして taken: "は既に使用されています。" blank: "が入力されていません。" too_short: "は%{count}文字以上に設定して下さい。" too_long

                                                          railsの日本語化 deviseの日本語化 - Qiita
                                                        • Railsでdevise_token_auth使ってトークン認証する - petitviolet_blog

                                                          Railsで認証を実装するのに有名なGemであるplataformatec/deviseを使ってトークン認証を実装するためのGemであるlynndylanhurley/devise_token_authを使ってトークンによる認証を実装する。 +αで少しカスタマイズする方法も書く。 ちなみにdeviseにもかつてはTokenAuthenticatableがあったらしいがなくなった。 バージョンはこちら。 $ bundle list | grep -e 'devise' -e ' rails ' * devise (4.7.1) * devise_token_auth (1.1.3) * rails (6.0.0) インストールと初期設定 公式ドキュメントとかを見れば良い。 $ echo "gem 'devise_token_auth'" >> Gemfile $ bundle install

                                                            Railsでdevise_token_auth使ってトークン認証する - petitviolet_blog
                                                          • Devise Authentication Strategies

                                                            Despite the rather grandiose title, this bit of extendable functionality that the popular Authentication library Devise exposes is really rather simple in concept. It’s also proved to be extremely useful, even though coming across it’s existence required a bit of detective work. Here’s the elevator pitch: Conceptually an authentication strategy is where you put the logic for authenticating a reque

                                                              Devise Authentication Strategies
                                                            • doorkeeper providerサンプルアプリに対応するOAuthクライアントをdeviseで作成した - @znz blog

                                                              doorkeeper-provider-app を使って SSO (Single Sign On) のように使うクライアントアプリを作成しました。 doorkeeper-devise-client-app で公開しています。 SSO は OAuth 2.0 の本来の使い方ではないので、不便な部分もありますが、 クライアント側の例として参考になると思います。 動作確認バージョン ruby 2.1.2 rails 4.1.4 bootstrap 3.2.0 devise 3.2.4 omniauth 1.2.2 omniauth-oauth2 1.2.0 bootstrap-sass 3.2.0.0 dotenv-rails 0.11.1 簡単な役割解説 provider は doorkeeper gem を入れている rails アプリ側で認証や認可を受け持ちます。 (OAuth の仕様的に

                                                              • Deviseでログイン時のみログアウトのリンクを表示する方法 - 森薫の日記

                                                                Rails | 14:58 | RailsのDeviseで、ログイン時のみログアウトのリンクを表示するコードは、以下のようになります。 if user_signed_in? %> link_to "Sign out", destroy_user_session_path, :method => :delete %> end %> 参考:Rails 3.0用にrestful_authentication から deviseに移行してみる - 発声練習

                                                                • API JSON authentication with Devise

                                                                  You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert

                                                                    API JSON authentication with Devise
                                                                  • devise をあまりオススメしない理由 - HsbtDiary(2015-01-20)

                                                                    ■ devise をあまりオススメしない理由 いまいち使うのに気が乗らない理由はこんな感じ コントローラレイヤ以降に作用する gem は inspect が物凄くやりにくい、params ないし、必要なコンテキストを全て揃えた上で、コントローラを new して action を呼んで、みたいなこと、考えただけでもだるい テストを書いていたとしても、環境要因、特にセッションとクッキーに影響して挙動が変わる箇所が多すぎるので、全ての環境で正しく再現することが難しい フルスタックすぎることから Rails よりも devise にロックインされることの方が多くなって負債化する そもそも devise で便利になることの多くは、自分で作ってもわけない物が多い 使うからには、devise のコードも全部読むし、PR も投げるしという前提かつ、上のようなことを全て乗り越えるつもりなら僕は止めません!

                                                                      devise をあまりオススメしない理由 - HsbtDiary(2015-01-20)
                                                                    • Installation - devise-token-auth

                                                                      InstallationAdd the following to your Gemfile:gem 'devise_token_auth'Then install the gem using bundle:bundle installNextConfigurationLast modified 5yr ago

                                                                        Installation - devise-token-auth
                                                                      • Allowing devise login with facebook account

                                                                        tags: Ruby on Rails, Authentication date: 2010-08-31 22:58:40.000000000Z ##Creating the application with devise authentication The first thing we need to do is create a new application with devise authentication:

                                                                        • Railsでdeviseを導入してユーザー管理機能を実装する - Qiita

                                                                          --省略-- class DeviseCreateUsers < ActiveRecord::Migration[6.0] def change create_table :users do |t| ## Database authenticatable t.string :nickname, null: false, default: "" t.string :email, null: false, default: "" t.string :encrypted_password, null: false, default: "" t.string :family_name, null: false, default: "" t.string :first_name, null: false, default: "" t.string :read_family, null: false,

                                                                            Railsでdeviseを導入してユーザー管理機能を実装する - Qiita
                                                                          • How To Implement Simple Authentication Without Devise

                                                                            Almost every web app requires a sign in form. In Ruby, the popular choice is the Devise gem for Rails. Devise gives you a lot of functionality out of the box, but it can also be frustrating. It has a lot of “magic,” and is heavily coupled to various parts of Rails. If you’re requirements don’t exactly fit the gem – for example, anonymous users – you will be wading through documentation, how-to’s,

                                                                            • devise が form_for のコントローラ指定を上書く問題が解消した - ヤンキーと経済とRubyとRailsと

                                                                              2015-01-11 devise が form_for のコントローラ指定を上書く問題が解消した ちょっと手こずった・・・devise でユーザー登録したりログインしたりするお馴染みのこのパスの中で発生。 [http://localhost:3000/users/sign_up] [http://localhost:3000/users/sign_in]↓上記 URL ページ内で、こう書くと、 <%= form_for (Contact.new), url: { controller: 'contacts', action: 'sending' }, remote: true do |f| %> <%= f.text_area :comment %> <%= f.submit %> <% end %> こんなエラーが出ます・・・え? users/contacts って何スカ? form

                                                                                devise が form_for のコントローラ指定を上書く問題が解消した - ヤンキーと経済とRubyとRailsと
                                                                              • Rails5 + APIモードで後からdeviseを使おうとした時のエラー対応 - Qiita

                                                                                APIモードでRails構築した後からdeviseでログイン画面作ろうとしてドハマリしたので、備忘録も兼ねて記述 ハマるまでの経緯 Rails + JSフレームワークでSPAを作ろうと考える APIサーバー構築のため、Rails5のAPIモードを使用 一般公開用ページとは他に、管理者用の管理ページ作成に着手 ログイン処理周りも全部SPAの枠組みで作ろうとすると認証とか大変だったので、管理ページはRailsに組み込むことにした deviseインストール + 初期設定をGithubのReadme見ながら実施 管理ページを開こうとするとエラーになって動かない! 実施した対応 エラーその1 undefined method 'flash' for#<ActionDispatch::Request> なんかflashメソッドが見つかんないって怒られてる 経緯5.まで実施して一番最初に発生 原因 Ra

                                                                                  Rails5 + APIモードで後からdeviseを使おうとした時のエラー対応 - Qiita
                                                                                • devise_parameter_sanitizerに変更があった模様 - Qiita

                                                                                  あくまでも,超個人的なメモ.全然まとまっていません. Ruby on RailsでDeviseを使っていて,認証まわりを全然いじっていなかったのにもかかわらず,ひさしぶりに認証関係のリンクをクリックしたら突如以下のようなエラーが出るようになった. Devise NoMethodError 'for' ParameterSanitizer どうやらDeviseのバージョンが新しくなって,devise_parameter_sanitizerまわりに変更があった模様. モデルのコントローラの中のconfigure_permitted_parametersで,今まで以下のように書いていた. def configure_permitted_parameters devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(:username, :em

                                                                                    devise_parameter_sanitizerに変更があった模様 - Qiita