美文网首页
ruby on rails devise

ruby on rails devise

作者: colorfulberry | 来源:发表于2014-10-07 13:39 被阅读0次

    <h2>1.add</h2>
    <pre> <span class="inner-pre" style="font-size: 20px">
    gem 'devise'
    bundle
    rails g devise:install
    </span></pre>
    <h2>2. configure </h2>
    <pre><span class="inner-pre" style="font-size: 20px">
    development.rb
    config.action_mailer.default_url_options = {:host=>'localhost:3000'}
    config.action_mailer.delivery_method =:stmp
    config.action_mailer.perform_deliveries=true

    layoutes/application.html.erb
    <xmp >
    <p calss="notice"><%= notice %></p>
    <p calss="alert"><%= alert %></p>
    </xmp>
    <%= yield %>
    </span></pre>
    <h2>3.page model</h2>
    <pre><span class="inner-pre" style="font-size: 20px">
    rails g devise:views
    rails g devise user
    modify create_user.migration select what you should
    rake db:migrate
    modify model to fit migration
    </span></pre>
    <h2>4.configure mailer</h2>
    <pre><span class="inner-pre" style="font-size: 20px">
    new file config initializers/setup_mail.rb
    ActionMailer::Base.delivery_method = :smtp
    ActionMailer::Base.smtp_settings = {
    :address => 'smtp.163.com'
    :port => '587'
    :authentication => :plain,
    :user_name => 'senluowanxiangt@163.com'
    :passowrd => '********'
    :domain => 'TDO'
    :enable_stattls_auto => true
    }
    </span></pre>

    相关文章

      网友评论

          本文标题:ruby on rails devise

          本文链接:https://www.haomeiwen.com/subject/lqxptttx.html