Created
April 8, 2014 03:12
-
-
Save halsk/10086482 to your computer and use it in GitHub Desktop.
LocomotiveCMS + Devise を使って作ったログインページのデザインをCMS側でできるようにする(1) ref: http://qiita.com/hal_sk/items/50c45f764cb95615dd59
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
include Locomotive::Routing::SiteDispatcher | |
include Locomotive::Render | |
include Locomotive::ActionController::LocaleHelpers |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Users::RegistrationsController < Devise::RegistrationsController | |
include Locomotive::Routing::SiteDispatcher | |
include Locomotive::Render | |
include Locomotive::ActionController::LocaleHelpers | |
before_filter :require_site | |
def new | |
build_resource({}) | |
@page ||= self.locomotive_page('/userregistration') | |
respond_to do |format| | |
format.html { | |
render :inline => @page.render(self.locomotive_context({ 'user' => resource})) | |
} | |
end | |
end | |
def create | |
super | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Users::RegistrationsController < Devise::RegistrationsController | |
def new | |
logger.debug 'test' | |
super | |
end | |
def create | |
super | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
devise_for :users, :controllers => { | |
:registrations => 'users/registrations' | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
title: ユーザー登録 | |
slug: userregistration | |
listed: false | |
published: true | |
cache_strategy: none | |
response_type: text/html | |
--- | |
{% extends 'parent' %} | |
{% block main %} | |
.row | |
.large-8.columns | |
%h1 ユーザー登録ページ | |
%form#new_user.new_user{"accept-charset" => "UTF-8", action: "/users", method: "post"} | |
.hidden | |
{% csrf_param %} | |
%input{name: "utf8", type: "hidden", value: "✓"}/ | |
%div | |
%label{for: "user_email"} Email | |
%br/ | |
%input#user_email{autofocus: "autofocus", keyev: "true", mouseev: "true", name: "user[email]", size: "30", type: "email", value: ""}/ | |
%div | |
%label{for: "user_password"} Password | |
%br/ | |
%input#user_password{keyev: "true", mouseev: "true", name: "user[password]", size: "30", type: "password"}/ | |
%div | |
%label{for: "user_password_confirmation"} Password confirmation | |
%br/ | |
%input#user_password_confirmation{keyev: "true", mouseev: "true", name: "user[password_confirmation]", size: "30", type: "password"}/ | |
%div | |
%input{name: "commit", type: "submit", value: "Sign up"}/ | |
{% endblock %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment