-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
gem => creditor, paperclip 추가 및 모델 생성, db 수정 및 Notice, freeboard 뷰 파일 수정
- Loading branch information
Showing
25 changed files
with
249 additions
and
96 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,31 @@ | ||
source 'https://rubygems.org' | ||
|
||
|
||
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails' | ||
gem 'ckeditor', github: 'galetahub/ckeditor' | ||
gem 'paperclip' | ||
|
||
gem 'rails', '4.2.5' | ||
# Use sqlite3 as the database for Active Record | ||
gem 'sqlite3' | ||
# Use SCSS for stylesheets | ||
gem 'sass-rails', '~> 5.0' | ||
gem 'bootstrap-sass', '~> 3.3.5' | ||
# Use Uglifier as compressor for JavaScript assets | ||
gem 'uglifier', '>= 1.3.0' | ||
# Use CoffeeScript for .coffee assets and views | ||
gem 'coffee-rails', '~> 4.1.0' | ||
# See https://github.com/rails/execjs#readme for more supported runtimes | ||
# gem 'therubyracer', platforms: :ruby | ||
|
||
# Use jquery as the JavaScript library | ||
gem 'jquery-rails' | ||
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks | ||
gem 'turbolinks' | ||
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder | ||
gem 'jbuilder', '~> 2.0' | ||
# bundle exec rake doc:rails generates the API under doc/api. | ||
gem 'sdoc', '~> 0.4.0', group: :doc | ||
|
||
# User | ||
gem 'devise' | ||
|
||
group :development, :test do | ||
# Call 'byebug' anywhere in the code to stop execution and get a debugger console | ||
gem 'byebug' | ||
end | ||
|
||
group :development do | ||
# Access an IRB console on exception pages or by using <%= console %> in views | ||
gem 'web-console', '~> 2.0' | ||
gem "better_errors" | ||
gem 'quiet_assets' | ||
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring | ||
gem 'spring' | ||
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
Binary file not shown.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,3 +14,4 @@ | |
//= require jquery_ujs | ||
//= require turbolinks | ||
//= require_tree . | ||
//= require ckeditor/init |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,4 +13,5 @@ | |
*= require_tree . | ||
*= require_self | ||
*/ | ||
|
||
|
||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,4 +11,8 @@ | |
font-size: 15px; | ||
background-color: rgba(58, 64, 136, 0.49); | ||
border-radius: 3px; | ||
} | ||
} | ||
|
||
a { | ||
color: rgb(6, 6, 6); | ||
} |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
class IndexController < ApplicationController | ||
|
||
def index | ||
@post = Post.all | ||
end | ||
@post = Post.all.last(5) | ||
@freeboard = Freeboard.all.last(5) | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,7 +22,7 @@ def create | |
end | ||
|
||
def show | ||
@post = Post.all | ||
@post = Post.find(params[:id]) | ||
end | ||
|
||
def update | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
class Ckeditor::Asset < ActiveRecord::Base | ||
include Ckeditor::Orm::ActiveRecord::AssetBase | ||
include Ckeditor::Backend::Paperclip | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
class Ckeditor::AttachmentFile < Ckeditor::Asset | ||
has_attached_file :data, | ||
:url => "/ckeditor_assets/attachments/:id/:filename", | ||
:path => ":rails_root/public/ckeditor_assets/attachments/:id/:filename" | ||
|
||
validates_attachment_presence :data | ||
validates_attachment_size :data, :less_than => 100.megabytes | ||
do_not_validate_attachment_file_type :data | ||
|
||
def url_thumb | ||
@url_thumb ||= Ckeditor::Utils.filethumb(filename) | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
class Ckeditor::Picture < Ckeditor::Asset | ||
has_attached_file :data, | ||
:url => "/ckeditor_assets/pictures/:id/:style_:basename.:extension", | ||
:path => ":rails_root/public/ckeditor_assets/pictures/:id/:style_:basename.:extension", | ||
:styles => { :content => '800>', :thumb => '118x100#' } | ||
|
||
validates_attachment_presence :data | ||
validates_attachment_size :data, :less_than => 2.megabytes | ||
validates_attachment_content_type :data, :content_type => /\Aimage/ | ||
|
||
def url_content | ||
url(:content) | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,37 @@ | ||
<h2>Log in</h2> | ||
<div class="row"> | ||
<div class="col-md-2"></div> | ||
|
||
<%= form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| %> | ||
<div class="field"> | ||
<%= f.label :email %><br /> | ||
<%= f.email_field :email, autofocus: true %> | ||
</div> | ||
|
||
<div class="field"> | ||
<%= f.label :password %><br /> | ||
<%= f.password_field :password, autocomplete: "off" %> | ||
</div> | ||
<div class="col-md-8"> | ||
<h2>로그인</h2> | ||
<%= form_for(resource, :html => {:class => 'form-horizontal'}, as: resource_name, url: session_path(resource_name)) do |f| %> | ||
<div class="form-group"> | ||
<%= f.label :email, :class => "col-sm-2 control-label", for: "email" %> | ||
<div class="col-sm-10"> | ||
<%= f.email_field :email, autofocus: true, id:"inputEmail3" , :class => "form-control", placeholder: "이메일" %> | ||
</div> | ||
</div> | ||
|
||
<% if devise_mapping.rememberable? -%> | ||
<div class="field"> | ||
<%= f.check_box :remember_me %> | ||
<%= f.label :remember_me %> | ||
<div class="form-group"> | ||
<%= f.label :password, :class => "col-sm-2 control-label", for: "password" %> | ||
<div class="col-sm-10"> | ||
<%= f.password_field :password, autocomplete: "off", :class => "form-control", placeholder: "비밀번호" %> | ||
</div> | ||
</div> | ||
<% end -%> | ||
|
||
<div class="actions"> | ||
<%= f.submit "Log in" %> | ||
<% if devise_mapping.rememberable? -%> | ||
<div class="form-group"> | ||
<%= f.check_box :remember_me%> | ||
<%= f.label :remember_me ,:class => "col-sm-2 control-label"%> | ||
</div> | ||
<% end %> | ||
<div class="form-group"> | ||
<div class="col-sm-offset-2 col-sm-10"> | ||
<div class="actions"> | ||
<%= f.submit("로그인",:class => "btn btn-default") %> | ||
</div> | ||
</div> | ||
</div> | ||
<% end %> | ||
</div> | ||
<% end %> | ||
|
||
<%= render "devise/shared/links" %> | ||
<div class="col-md-2"> </div> | ||
</div> |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<%= form_for @freeboard, class: "form-control", url: {action: "create"} do |f| %> | ||
<%= f.text_field :title , class: "form-control", placeholder: "타이틀", :required => true, autofocus: true %> | ||
<%= f.text_field :author, class: "form-control", placeholder: "작성자" %> | ||
<!-- <%= f.text_area :content, size: "25x4" , class: "form-control" , placeholder: "내용" %> --> | ||
<%= f.cktext_area :content, rows: 10 %> | ||
<%= f.submit "제출", class: "btn btn-default" %> | ||
<% 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<% if flash[:notice] %> | ||
<div class="notice"> | ||
<div class="alert alert-success alert-dismissible" role="alert"> | ||
<button type="button" class="close" data-dismiss="alert" aria-label="Close"> | ||
<span aria-hidden="true">×</span> | ||
</button> | ||
<%= flash[:notice] %> | ||
</div> | ||
</div> | ||
<% 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
Oops, something went wrong.