Commit 38025573 by phuctmZigexn

temp commit

parent 86eea23a
...@@ -3,6 +3,11 @@ ...@@ -3,6 +3,11 @@
/* mixins, variables, etc */ /* mixins, variables, etc */
$gray-medium-light: #eaeaea; $gray-medium-light: #eaeaea;
@mixin box_sizing {
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
body { body {
padding-top: 60px; padding-top: 60px;
...@@ -94,3 +99,59 @@ footer { ...@@ -94,3 +99,59 @@ footer {
} }
} }
.debug_dump {
clear: both;
float: left;
width: 100%;
margin-top: 45px;
@include box_sizing;
}
// sidebar
aside {
section.user_info {
margin-top: 20px;
}
section {
padding: 10px 0;
margin-top: 20px;
&:first-child {
border: 0;
padding-top: 0;
}
span {
display: block;
margin-top: 3px;
line-height: 1;
}
h1 {
font-size: 1.4em;
text-align: left;
letter-spacing: -1px;
margin-bottom: 3px;
margin-top: 0px;
}
}
}
.gravatar {
float: left;
margin-right: 10px;
}
.gravatar_edit {
margin-top: 15px;
}
// form
input, textarea, select, .uneditable-input {
border: 1px solid #bbb;
width: 100%;
margin-bottom: 15px;
@include box_sizing;
}
input {
height: auto !important;
}
\ No newline at end of file
class UsersController < ApplicationController class UsersController < ApplicationController
def show
@user = User.find(params[:id])
# debugger
end
def new
@user = User.new
end
def create
@user = User.new(params[:user])
if @user.save
else
render 'new'
end
end
end end
module UsersHelper
def gravatar_for(user, size: 80)
gravatar_id = Digest::MD5::hexdigest(user.email.downcase)
gravatar_url = "https://secure.gravatar.com/avatar/#{gravatar_id}?s=#{size}"
image_tag(gravatar_url, alt: user.name, class: "gravatar")
end
end
\ No newline at end of file
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
<div class="container"> <div class="container">
<%= yield %> <%= yield %>
<%= render 'layouts/footer' %> <%= render 'layouts/footer' %>
<%= debug(params) if Rails.env.development? %> <!-- display debug information about each page -->
</div> </div>
</body> </body>
</html> </html>
<% provide(:title, 'Sign up') %> <% provide(:title, 'Sign up') %>
<h1>Sign up</h1> <h1>Sign up</h1>
<p>This will be a signup page for new users.</p>
\ No newline at end of file <div class="row">
<div class="col-md-6 col-md-offet-3">
<%= form_for @user do |f| %>
<%= f.label :name %>
<%= f.text_field :name %>
<%= f.label :email %>
<%= f.email_field :email %>
<%= f.label :password %>
<%= f.password_field :password %>
<%= f.label :password_confirmation, "Confirmation" %>
<%= f.password_field :password_confirmation %>
<%= f.submit "Create my account", class: "btn btn-primary" %>
<% end %>
</div>
</div>
\ No newline at end of file
<% provide(:title, @user.name) %>
<div class="row">
<aside class="col-md-4">
<section class="user_info">
<h1>
<%= gravatar_for @user %>
<%= @user.name %>
</h1>
</section>
</aside>
</div>
...@@ -4,4 +4,6 @@ Rails.application.routes.draw do ...@@ -4,4 +4,6 @@ Rails.application.routes.draw do
get '/about', to: 'static_pages#about' get '/about', to: 'static_pages#about'
get '/contact', to: 'static_pages#contact' get '/contact', to: 'static_pages#contact'
get '/signup', to: 'users#new' get '/signup', to: 'users#new'
resources :users
end end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment