-
Notifications
You must be signed in to change notification settings - Fork 22
add static page to user model #93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
CLJoker
wants to merge
1
commit into
hellovietnam93:dao_bao_quang_20143564
Choose a base branch
from
CLJoker:sugoi_page_03
base: dao_bao_quang_20143564
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,9 @@ | ||
| *.gem | ||
| *.rbc | ||
| /.config | ||
| /config/secrets.yml | ||
| /config/database.yml | ||
| /log/ | ||
| /coverage/ | ||
| /InstalledFiles | ||
| /pkg/ | ||
|
|
||
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,55 +1,33 @@ | ||
| source 'https://rubygems.org' | ||
| source "https://rubygems.org" | ||
|
|
||
| git_source(:github) do |repo_name| | ||
| repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/") | ||
| "https://github.com/#{repo_name}.git" | ||
| end | ||
|
|
||
| gem "rails", "~> 5.0.2" | ||
|
|
||
| # Bundle edge Rails instead: gem 'rails', github: 'rails/rails' | ||
| gem 'rails', '~> 5.0.2' | ||
| # Use sqlite3 as the database for Active Record | ||
| gem 'bcrypt', '3.1.7' | ||
| # | ||
| gem 'sqlite3' | ||
| # Use Puma as the app server | ||
| gem 'puma', '~> 3.0' | ||
| # Use SCSS for stylesheets | ||
| gem 'sass-rails', '~> 5.0' | ||
| # Use Uglifier as compressor for JavaScript assets | ||
| gem 'uglifier', '>= 1.3.0' | ||
| # Use CoffeeScript for .coffee assets and views | ||
| gem 'coffee-rails', '~> 4.2' | ||
| # See https://github.com/rails/execjs#readme for more supported runtimes | ||
| # gem 'therubyracer', platforms: :ruby | ||
| gem "bcrypt", "3.1.7" | ||
|
|
||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. xóa dòng nhé |
||
| # Use jquery as the JavaScript library | ||
| gem 'jquery-rails' | ||
| # Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks | ||
| gem 'turbolinks', '~> 5' | ||
| # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder | ||
| gem 'jbuilder', '~> 2.5' | ||
| # Use Redis adapter to run Action Cable in production | ||
| # gem 'redis', '~> 3.0' | ||
| # Use ActiveModel has_secure_password | ||
| # gem 'bcrypt', '~> 3.1.7' | ||
|
|
||
| # Use Capistrano for deployment | ||
| # gem 'capistrano-rails', group: :development | ||
| gem "bootstrap-sass","3.3.7" | ||
| gem "sqlite3" | ||
| gem "puma", "~> 3.0" | ||
| gem "sass-rails", "~> 5.0" | ||
| gem "uglifier", ">= 1.3.0" | ||
| gem "coffee-rails", "~> 4.2" | ||
| gem "jquery-rails" | ||
| gem "turbolinks", "~> 5" | ||
| gem "jbuilder", "~> 2.5" | ||
|
|
||
| group :development, :test do | ||
| # Call 'byebug' anywhere in the code to stop execution and get a debugger console | ||
| gem 'byebug', platform: :mri | ||
| gem "byebug", platform: :mri | ||
| end | ||
|
|
||
| group :development do | ||
| # Access an IRB console on exception pages or by using <%= console %> anywhere in the code. | ||
| gem 'web-console', '>= 3.3.0' | ||
| gem 'listen', '~> 3.0.5' | ||
| # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring | ||
| gem 'spring' | ||
| gem 'spring-watcher-listen', '~> 2.0.0' | ||
| gem "web-console", ">= 3.3.0" | ||
| gem "listen", "~> 3.0.5" | ||
| gem "spring" | ||
| gem "spring-watcher-listen", "~> 2.0.0" | ||
| end | ||
|
|
||
| # Windows does not include zoneinfo files, so bundle the tzinfo-data gem | ||
| gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby] | ||
| gem "tzinfo-data", platforms: [:mingw, :mswin, :x64_mingw, :jruby] | ||
This file contains hidden or 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,181 @@ | ||
| @import "bootstrap-sprockets"; | ||
| @import "bootstrap"; | ||
|
|
||
| /* mixins, variables, etc. */ | ||
|
|
||
| $gray-medium-light: #eaeaea; | ||
|
|
||
| @mixin box_sizing | ||
| { | ||
| -moz-box-sizing: border-box; | ||
| -webkit-box-sizing: border-box; | ||
| box-sizing: border-box; | ||
| } | ||
|
|
||
| /* miscellaneous */ | ||
|
|
||
| .debug_dump { | ||
| clear: both; | ||
| float: left; | ||
| width: 100%; | ||
| margin-top: 45px; | ||
| @include box_sizing; | ||
| } | ||
|
|
||
| /* universal */ | ||
|
|
||
| body { | ||
| padding-top: 60px; | ||
| } | ||
|
|
||
| section { | ||
| overflow: auto; | ||
| } | ||
|
|
||
| textarea { | ||
| resize: vertical; | ||
| } | ||
|
|
||
| .center { | ||
| text-align: center; | ||
| h1 { | ||
| margin-bottom: 10px; | ||
| } | ||
| } | ||
|
|
||
| /* typography */ | ||
|
|
||
| h1, h2, h3, h4, h5, h6 { | ||
| line-height: 1; | ||
| } | ||
|
|
||
| h1 { | ||
| font-size: 3em; | ||
| letter-spacing: -2px; | ||
| margin-bottom: 30px; | ||
| text-align: center; | ||
| } | ||
|
|
||
| h2 { | ||
| font-size: 1.2em; | ||
| letter-spacing: -1px; | ||
| margin-bottom: 30px; | ||
| text-align: center; | ||
| font-weight: normal; | ||
| color: $gray-light; | ||
| } | ||
|
|
||
| p { | ||
| font-size: 1.1em; | ||
| line-height: 1.7em; | ||
| } | ||
|
|
||
| /* header */ | ||
|
|
||
| #logo | ||
| { | ||
| float: left; | ||
| margin-right: 10px; | ||
| font-size: 1.7em; | ||
| color: white; | ||
| text-transform: uppercase; | ||
| letter-spacing: -1px; | ||
| padding-top: 9px; | ||
| font-weight: bold; | ||
| &:hover { | ||
| color: white; | ||
| text-decoration: none; | ||
| } | ||
| } | ||
|
|
||
| /* footer */ | ||
|
|
||
| footer | ||
| { | ||
| margin-top: 45px; | ||
| padding-top: 5px; | ||
| border-top: 1px solid $gray-medium-light; | ||
| color: $gray-light; | ||
| a { | ||
| color: $gray; | ||
| &:hover { | ||
| color: $gray-darker; | ||
| } | ||
| } | ||
| small { | ||
| float: left; | ||
| } | ||
| ul { | ||
| float: right; | ||
| list-style: none; | ||
| li { | ||
| float: left; | ||
| margin-left: 15px; | ||
| } | ||
| } | ||
| } | ||
|
|
||
| /* 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-bottom: 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; | ||
| } | ||
|
|
||
| /* forms */ | ||
|
|
||
| input, textarea, select, .uneditable-input { | ||
| border: 1px solid #bbb; | ||
| width: 100%; | ||
| margin-bottom: 15px; | ||
| @include box_sizing; | ||
| } | ||
|
|
||
| input { | ||
| height: auto !important; | ||
| } | ||
|
|
||
| #error_explanation { | ||
| color: red; | ||
| ul { | ||
| color: red; | ||
| margin: 0 0 30px 0; | ||
| } | ||
| } | ||
|
|
||
| .field_with_errors { | ||
| @extend .has-error; | ||
| .form-control { | ||
| color: $state-danger-text; | ||
| } | ||
| } |
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| class StaticPagesController < ApplicationController | ||
| def home | ||
| end | ||
|
|
||
| def help | ||
| end | ||
|
|
||
| def about | ||
| end | ||
|
|
||
| def sign_up | ||
| end | ||
| end |
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| class UsersController < ApplicationController | ||
| def new | ||
| @user = User.new | ||
| end | ||
|
|
||
| def show | ||
| @user = User.find params[:id] | ||
| end | ||
|
|
||
| def create | ||
| @user = User.new user_params | ||
| if @user.save | ||
| flash[:success] = "Welcome to the Sample App!" | ||
| redirect_to @user | ||
| else | ||
| render :new | ||
| end | ||
| end | ||
|
|
||
| private | ||
|
|
||
| def user_params | ||
| params.require(:user).permit :name, :email, :phonenumber, :birthday, | ||
| :password, :password_confirmation | ||
| end | ||
| end |
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,10 @@ | ||
| module ApplicationHelper | ||
| def full_title page_title = "" | ||
| base_title = "Ruby on Rails Tutorial Sample App" | ||
| if page_title.empty? | ||
| base_title | ||
| else | ||
| page_title + " | " + base_title | ||
| end | ||
| end | ||
| end |
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| 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 |
This file contains hidden or 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
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| <footer class="footer"> | ||
| <small> | ||
| The <a href="http://www.railstutorial.org/">Ruby on Rails Tutorial</a> | ||
| by <a href="http://www.michaelhartl.com/">Michael Hartl</a> | ||
| </small> | ||
| <nav> | ||
| <ul> | ||
| <li><%= link_to "About", static_pages_about_path %></li> | ||
| <li><%= link_to "Contact", '#' %></li> | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. use double quote |
||
| <li><a href="http://news.railstutorial.org/">News</a></li> | ||
| </ul> | ||
| </nav> | ||
| </footer> | ||
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| <header class="navbar navbar-fixed-top navbar-inverse"> | ||
| <div class="container"> | ||
| <%= link_to "Sample App", "#", id: "logo" %> | ||
| <nav> | ||
| <ul class="nav navbar-nav navbar-right"> | ||
| <li><%= link_to "Home", static_pages_home_path %></li> | ||
| <li><%= link_to "Help", static_pages_help_path %></li> | ||
| <li><%= link_to "Log in", "#" %></li> | ||
| </ul> | ||
| </nav> | ||
| </div> | ||
| </header> |
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| <%= csrf_meta_tags %> | ||
| <%= stylesheet_link_tag "application", media: "all", "data-turbolinks-track": "reload" %> | ||
| <%= javascript_include_tag "application", "data-turbolinks-track": "reload" %> |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
xóa dòng này em nhé