Sha256: e495c2c2fb34f8b90f98e1ae2d350e6bebaa023d7a820de5ff5db6a430caec8d
Contents?: true
Size: 826 Bytes
Versions: 1
Compression:
Stored size: 826 Bytes
Contents
<%= @app_name %>::Admin.controllers :sessions do get :new do render "/sessions/new", nil, :layout => false end post :create do if account = <%= @model_name %>.authenticate(params[:email], params[:password]) set_current_account(account) redirect url(:base, :index) elsif Padrino.env == :development && params[:bypass] <%- if @orm == :ohm -%> account = <%= @model_name %>.all.first <%- else -%> account = <%= @model_name %>.first <%- end -%> set_current_account(account) redirect url(:base, :index) else params[:email] = h(params[:email]) flash.now[:error] = pat('login.error') render "/sessions/new", nil, :layout => false end end delete :destroy do set_current_account(nil) redirect url(:sessions, :new) end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
padrino-admin-0.12.0.rc1 | lib/padrino-admin/generators/templates/app/controllers/sessions.rb.tt |