zarigani / todo_stateful_template Goto Github PK
View Code? Open in Web Editor NEWrestful_authentication + forgot_password + change_email + login_by_email + role_permission + aasm + ruby-gettext + menu&footer
restful_authentication + forgot_password + change_email + login_by_email + role_permission + aasm + ruby-gettext + menu&footer
ログイン認証の雛形プロジェクトです。 - rails 2.1、sqlite 3、gmailの環境で若干の設定をして、すぐに稼働することができます。 ===config/initializers/mail.rbの設定 USERNAME = 'xxxxxx' #@gmail.comを除くユーザー名を設定 PASSWORD = 'xxxxxx' #パスワードを設定 ...(中略)... ===app/models/user_mailer.rbの設定 class UserMailer < ActionMailer::Base YOURSITE = 'localhost:3000' #サーバーのURLが'http://localhost:3000/'の場合 ...(中略)... ===ログインの方法 ログイン名:: admin パスワード:: admin ===メモ - rake db:migrateまたはdb:migrate:resetによって、administrator権限を持ったadminユーザーも生成されます。 - その際、上記メールの設定が正しく行われている場合、ユーザー登録とそのアクティベーション完了のメールも送信されます。 - DBのusersテーブルには、login,email,nameフィールドが存在しています。 - このアプリケーションでは、login,emailフィールドのみ使用しています。nameフィールドは未使用です。 - loginまたはemailどちらを使ってもログインできるようになっています。この設定は必要に応じてカスタマイズしてください。 - 追加するより削除する方が簡単なので、余分と思われるコードもそのまま残しています。 - 権限(role)によるアクセス制限は、改善の余地大いにありです。 - 2、3の権限を設定して単純なアクセス制限なら対応できますが、 - 数多くの権限を設定して複雑なアクセス制限をする時には、工夫しないと破綻しそうです。 - 可能な限りrestful_authenticationのファイルや生成したコードは修正しないようにしています。 - aasmを有効にするためにinit.rbは修正しました。 - 状態管理のコードはアプリケーションの仕様によって修正する可能性大なので、本来はaasm_roles.rbやstateful_roles.rbをアプリケーションルートのlibフォルダにコピーしておくべきかもしれません。 - そうすればinit.rbの修正も不要になり、プラグインのアップデートもやり易くなると思います。
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.