├── .gitignore ├── Gemfile ├── Gemfile.lock ├── README.md ├── README.rdoc ├── Rakefile ├── app ├── assets │ ├── audios │ │ ├── chimes.wav │ │ └── desktop.ini │ ├── images │ │ ├── .keep │ │ ├── expensive.gif │ │ ├── fav-icon.png │ │ ├── favicon.ico │ │ ├── fish.jpg │ │ └── wings_logo.gif │ ├── javascripts │ │ ├── admin │ │ │ └── books.js.coffee │ │ ├── ajax.js.coffee │ │ ├── application.js │ │ ├── authors.js.coffee │ │ ├── books.js.coffee │ │ ├── extra.js.coffee │ │ ├── fan_comments.js.coffee │ │ ├── hello.js.coffee │ │ ├── members.js.coffee │ │ ├── reviews.js.coffee │ │ └── users.js.coffee │ ├── stylesheets │ │ ├── admin │ │ │ └── books.css.scss │ │ ├── ajax.css.scss │ │ ├── application.css │ │ ├── authors.css.scss │ │ ├── books.css.scss │ │ ├── extra.css.scss │ │ ├── fan_comments.css.scss │ │ ├── hello.css.scss │ │ ├── members.css.scss │ │ ├── reviews.css.scss │ │ ├── scaffolds.css.scss │ │ └── users.css.scss │ └── videos │ │ ├── child │ │ └── sample.mp4 │ │ └── sample_mpeg4.mp4 ├── controllers │ ├── admin │ │ └── books_controller.rb │ ├── ajax_controller.rb │ ├── application_controller.rb │ ├── authors_controller.rb │ ├── books_controller.rb │ ├── concerns │ │ ├── .keep │ │ └── form_auth.rb │ ├── ctrl_controller.rb │ ├── extra_controller.rb │ ├── fan_comments_controller.rb │ ├── hello_controller.rb │ ├── login_controller.rb │ ├── members_controller.rb │ ├── record_controller.rb │ ├── reviews_controller.rb │ ├── sample_controller.rb │ ├── users_controller.rb │ └── view_controller.rb ├── helpers │ ├── admin │ │ └── books_helper.rb │ ├── ajax_helper.rb │ ├── application_helper.rb │ ├── authors_helper.rb │ ├── books_helper.rb │ ├── extra_helper.rb │ ├── fan_comments_helper.rb │ ├── hello_helper.rb │ ├── members_helper.rb │ ├── reviews_helper.rb │ ├── users_helper.rb │ └── view_helper.rb ├── mailers │ ├── .keep │ ├── notice_mailer.rb │ └── test_mailto_interceptor.rb ├── models │ ├── .keep │ ├── TimeConstraint.rb │ ├── author.rb │ ├── book.rb │ ├── book_callbacks.rb │ ├── compare_validator.rb │ ├── concerns │ │ └── .keep │ ├── fan_comment.rb │ ├── isbn_validator.rb │ ├── member.rb │ ├── memo.rb │ ├── review.rb │ ├── search_keyword.rb │ └── user.rb └── views │ ├── ajax │ ├── _ajax_result.html.erb │ ├── _search_result.html.erb │ ├── index.html.erb │ ├── keywd.html.erb │ ├── result.js.erb │ ├── result.json.jbuilder │ ├── search.html.erb │ └── upanel.js.erb │ ├── authors │ ├── _form.html.erb │ ├── edit.html.erb │ ├── index.html.erb │ ├── index.json.jbuilder │ ├── new.html.erb │ ├── show.html.erb │ └── show.json.jbuilder │ ├── books │ ├── _book.html.erb │ ├── _form.html.erb │ ├── edit.html.erb │ ├── index.atom.builder │ ├── index.html.erb │ ├── index.json.jbuilder │ ├── index.xml.builder │ ├── index.xml.erb │ ├── new.html.erb │ ├── show.html.erb │ └── show.json.jbuilder │ ├── ctrl │ ├── cookie.html.erb │ ├── details_info.html.erb │ ├── download.csv.ruby │ ├── dummy.html.erb │ ├── index.html.erb │ ├── link.html.erb │ ├── pass.html.erb │ ├── req_head2.html.erb │ ├── session_show.html.erb │ ├── simple_info.html.erb │ ├── trans.html.erb │ ├── trans2.html.erb │ ├── updb.html.erb │ └── upload.html.erb │ ├── extra │ ├── _share.html.erb │ ├── f_cache.html.erb │ ├── model.html.erb │ ├── model2.html.erb │ ├── paging.html.erb │ ├── share1.html.erb │ ├── share2.html.erb │ └── trans.html.erb │ ├── fan_comments │ ├── _form.html.erb │ ├── edit.html.erb │ ├── index.html.erb │ ├── index.json.jbuilder │ ├── new.html.erb │ ├── show.html.erb │ └── show.json.jbuilder │ ├── hello │ ├── helper.html.erb │ ├── list.html.erb │ ├── special.html.erb │ ├── test.html.erb │ └── view.html.erb │ ├── layouts │ ├── application.html.erb │ ├── books.html.erb │ ├── child.html.erb │ ├── layout.html.erb │ ├── mail.text.erb │ ├── product.html.erb │ └── sub.html.erb │ ├── login │ └── index.html.erb │ ├── members │ ├── _form.html.erb │ ├── edit.html.erb │ ├── index.html.erb │ ├── index.json.jbuilder │ ├── new.html.erb │ ├── show.html.erb │ └── show.json.jbuilder │ ├── notice_mailer │ ├── sendmail_confirm.html.erb │ └── sendmail_confirm.text.erb │ ├── record │ ├── assoc_includes.html.erb │ ├── assoc_join.html.erb │ ├── assoc_join2.html.erb │ ├── assoc_join3.html.erb │ ├── belongs.html.erb │ ├── groupby.html.erb │ ├── groupby2.html.erb │ ├── has_and_belongs.html.erb │ ├── has_many_through.html.erb │ ├── hasmany.html.erb │ ├── hasone.html.erb │ ├── keywd.html.erb │ ├── keyword.html.erb │ └── select2.html.erb │ ├── reviews │ ├── _form.html.erb │ ├── _review.html.erb │ ├── edit.html.erb │ ├── index.html.erb │ ├── index.json.jbuilder │ ├── new.html.erb │ ├── show.html.erb │ └── show.json.jbuilder │ ├── shared │ └── record_not_found.html.erb │ ├── users │ ├── _form.html.erb │ ├── edit.html.erb │ ├── index.html.erb │ ├── index.json.jbuilder │ ├── new.html.erb │ ├── show.html.erb │ └── show.json.jbuilder │ └── view │ ├── _separator.html.erb │ ├── adopt.html.erb │ ├── audio.html.erb │ ├── capture.html.erb │ ├── col_radio.html.erb │ ├── col_select.html.erb │ ├── col_select2.html.erb │ ├── conc.html.erb │ ├── content_tag.html.erb │ ├── current.html.erb │ ├── dat_select.html.erb │ ├── datetime.html.erb │ ├── discovery.html.erb │ ├── excerpt.html.erb │ ├── field.html.erb │ ├── fields.html.erb │ ├── form_for.html.erb │ ├── form_for2.html.erb │ ├── form_for3.html.erb │ ├── form_tag.html.erb │ ├── format.html.erb │ ├── group_select.html.erb │ ├── group_select2.html.erb │ ├── helper.html.erb │ ├── helper2.html.erb │ ├── helper3.html.erb │ ├── highlight.html.erb │ ├── html5.html.erb │ ├── image_tag.html.erb │ ├── keyword.html.erb │ ├── link.html.erb │ ├── linkif.html.erb │ ├── mailto.html.erb │ ├── multi.html.erb │ ├── nest.html.erb │ ├── number_to.html.erb │ ├── partial_basic.html.erb │ ├── partial_col.html.erb │ ├── partial_param.html.erb │ ├── partial_spacer.html.erb │ ├── path.html.erb │ ├── sanitize.html.erb │ ├── select.html.erb │ ├── select_tag.html.erb │ ├── select_tag2.html.erb │ ├── simple_format.html.erb │ ├── tag.html.erb │ ├── truncate.html.erb │ ├── urlfor.html.erb │ └── video.html.erb ├── bin ├── bundle ├── rails └── rake ├── config.ru ├── config ├── application.rb ├── boot.rb ├── database.yml ├── environment.rb ├── environments │ ├── development.rb │ ├── production.rb │ └── test.rb ├── initializers │ ├── backtrace_silencers.rb │ ├── filter_parameter_logging.rb │ ├── inflections.rb │ ├── mime_types.rb │ ├── my_config.rb │ ├── secret_token.rb │ ├── session_store.rb │ ├── test_mail_config.rb │ └── wrap_parameters.rb ├── locales │ ├── de.yml │ ├── en.yml │ ├── ko.yml │ └── models │ │ └── book │ │ └── ja.yml ├── my_config.yml └── routes.rb ├── db ├── migrate │ ├── 20130913051910_create_books.rb │ ├── 20130914060842_create_users.rb │ ├── 20130914060904_create_authors.rb │ ├── 20130914060920_create_reviews.rb │ ├── 20130914060936_create_fan_comments.rb │ ├── 20130915061456_create_members.rb │ ├── 20131005063736_create_memos.rb │ └── 20140118053815_create_join_table_author_book.rb ├── schema.rb ├── seeds.rb └── structure.sql ├── doc └── app │ ├── Admin.html │ ├── Admin │ ├── BooksController.html │ └── BooksHelper.html │ ├── AjaxController.html │ ├── AjaxHelper.html │ ├── ApplicationController.html │ ├── ApplicationHelper.html │ ├── Author.html │ ├── AuthorsController.html │ ├── AuthorsHelper.html │ ├── Book.html │ ├── BookCallbacks.html │ ├── BooksController.html │ ├── BooksHelper.html │ ├── CompareValidator.html │ ├── CtrlController.html │ ├── ExtraController.html │ ├── ExtraHelper.html │ ├── FanComment.html │ ├── FanCommentsController.html │ ├── FanCommentsHelper.html │ ├── FormAuth.html │ ├── HelloController.html │ ├── HelloHelper.html │ ├── IsbnValidator.html │ ├── LoginController.html │ ├── Member.html │ ├── MembersController.html │ ├── MembersHelper.html │ ├── Memo.html │ ├── NoticeMailer.html │ ├── README_rdoc.html │ ├── RecordController.html │ ├── Review.html │ ├── ReviewsController.html │ ├── ReviewsHelper.html │ ├── SampleController.html │ ├── SearchKeyword.html │ ├── TestMailtoInterceptor.html │ ├── TimeConstraint.html │ ├── User.html │ ├── UsersController.html │ ├── UsersHelper.html │ ├── ViewController.html │ ├── ViewHelper.html │ ├── created.rid │ ├── css │ ├── fonts.css │ └── rdoc.css │ ├── fonts │ ├── Lato-Light.ttf │ ├── Lato-LightItalic.ttf │ ├── Lato-Regular.ttf │ ├── Lato-RegularItalic.ttf │ ├── SourceCodePro-Bold.ttf │ └── SourceCodePro-Regular.ttf │ ├── images │ ├── add.png │ ├── arrow_up.png │ ├── brick.png │ ├── brick_link.png │ ├── bug.png │ ├── bullet_black.png │ ├── bullet_toggle_minus.png │ ├── bullet_toggle_plus.png │ ├── date.png │ ├── delete.png │ ├── find.png │ ├── loadingAnimation.gif │ ├── macFFBgHack.png │ ├── package.png │ ├── page_green.png │ ├── page_white_text.png │ ├── page_white_width.png │ ├── plugin.png │ ├── ruby.png │ ├── tag_blue.png │ ├── tag_green.png │ ├── transparent.png │ ├── wrench.png │ ├── wrench_orange.png │ └── zoom.png │ ├── index.html │ ├── js │ ├── darkfish.js │ ├── jquery.js │ ├── navigation.js │ ├── navigation.js.gz │ ├── search.js │ ├── search_index.js │ ├── search_index.js.gz │ ├── searcher.js │ └── searcher.js.gz │ └── table_of_contents.html ├── lib ├── assets │ └── .keep └── tasks │ └── .keep ├── log └── .keep ├── public ├── 404.html ├── 422.html ├── 500.html ├── assets │ ├── application-12b3c7dd74d2e9df37e7cbb1efa76a6d.css │ ├── application-12b3c7dd74d2e9df37e7cbb1efa76a6d.css.gz │ ├── application-89263912e8385765bd57cd2fa026dd0e.js │ ├── application-89263912e8385765bd57cd2fa026dd0e.js.gz │ ├── chimes-29587febd995cdd099fcb2a3a888f0d3.wav │ ├── desktop-3c57fbf7ddab44ab42ceb3c723e4c36e.ini │ ├── fav-icon-91e6ea59f2dd4774bccce741269d5c32.png │ ├── favicon-f25e19e103e8db47bb74fefd2dc2bdf1.ico │ └── manifest-aa873fb3633eb11c3c0c2dd1fb243c1e.json ├── favicon.ico ├── icons │ ├── Thumbs.db │ └── button.gif └── robots.txt ├── test ├── controllers │ ├── .keep │ ├── admin │ │ └── books_controller_test.rb │ ├── ajax_controller_test.rb │ ├── authors_controller_test.rb │ ├── books_controller_test.rb │ ├── extra_controller_test.rb │ ├── fan_comments_controller_test.rb │ ├── hello_controller_test.rb │ ├── members_controller_test.rb │ ├── reviews_controller_test.rb │ └── users_controller_test.rb ├── fixtures │ ├── .keep │ ├── authors.yml │ ├── authors_books.yml │ ├── books.yml │ ├── fan_comments.yml │ ├── members.yml │ ├── notice_mailer │ │ └── sendmail_confirm │ ├── reviews.yml │ └── users.yml ├── helpers │ ├── .keep │ ├── admin │ │ └── books_helper_test.rb │ ├── ajax_helper_test.rb │ ├── authors_helper_test.rb │ ├── books_helper_test.rb │ ├── extra_helper_test.rb │ ├── fan_comments_helper_test.rb │ ├── hello_helper_test.rb │ ├── members_helper_test.rb │ ├── reviews_helper_test.rb │ ├── users_helper_test.rb │ └── view_helper_test.rb ├── integration │ ├── .keep │ └── admin_login_test.rb ├── mailers │ ├── .keep │ └── notice_mailer_test.rb ├── models │ ├── .keep │ ├── author_test.rb │ ├── book_test.rb │ ├── fan_comment_test.rb │ ├── member_test.rb │ ├── memo_test.rb │ ├── review_test.rb │ └── user_test.rb └── test_helper.rb └── vendor └── assets ├── javascripts └── .keep └── stylesheets └── .keep /.gitignore: -------------------------------------------------------------------------------- 1 | # See http://help.github.com/ignore-files/ for more about ignoring files. 2 | # 3 | # If you find yourself ignoring temporary files generated by your text editor 4 | # or operating system, you probably want to add a global ignore instead: 5 | # git config --global core.excludesfile '~/.gitignore_global' 6 | 7 | # Ignore bundler config. 8 | /.bundle 9 | 10 | # Ignore the default SQLite database. 11 | /db/*.sqlite3 12 | /db/*.sqlite3-journal 13 | 14 | # Ignore all logfiles and tempfiles. 15 | /log/*.log 16 | /tmp 17 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | source 'https://rubygems.org' 2 | 3 | # Bundle edge Rails instead: gem 'rails', github: 'rails/rails' 4 | gem 'rails', '>=4.0.2' 5 | 6 | # Use sqlite3 as the database for Active Record 7 | gem 'sqlite3' 8 | #gem 'pg' 9 | 10 | gem 'will_paginate' 11 | 12 | # Use SCSS for stylesheets 13 | gem 'sass-rails', '~> 4.0.0' 14 | 15 | # Use Uglifier as compressor for JavaScript assets 16 | gem 'uglifier', '>= 1.3.0' 17 | 18 | # Use CoffeeScript for .js.coffee assets and views 19 | gem 'coffee-rails', '~> 4.0.0' 20 | 21 | # See https://github.com/sstephenson/execjs#readme for more supported runtimes 22 | # gem 'therubyracer', platforms: :ruby 23 | 24 | # Use jquery as the JavaScript library 25 | gem 'jquery-rails' 26 | 27 | # Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks 28 | gem 'turbolinks' 29 | 30 | # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder 31 | gem 'jbuilder', '~> 1.2' 32 | 33 | group :doc do 34 | # bundle exec rake doc:rails generates the API under doc/api. 35 | gem 'sdoc', require: false 36 | end 37 | 38 | # Use ActiveModel has_secure_password 39 | # gem 'bcrypt-ruby', '~> 3.0.0' 40 | 41 | # Use unicorn as the app server 42 | # gem 'unicorn' 43 | 44 | # Use Capistrano for deployment 45 | # gem 'capistrano', group: :development 46 | 47 | # Use debugger 48 | # gem 'debugger', group: [:development, :test] 49 | 50 | # Windows does not include zoneinfo files, so bundle the tzinfo-data gem 51 | gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby] -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | # 퍼펙트 루비 온 레일즈 3 | 4 |  5 | 6 | **출판사** 제이펍 7 | **원출판사** 기술평론사 8 | **원서명** Ruby on Rails 4 アプリケーションプログラミング(원서 ISBN: 9784774164106) 9 | **저자명** 야마다 요시히로 10 | **역자명** 윤인성 11 | **출판일** 2015년 11월 30일 12 | **페이지** 660쪽 13 | **ISBN** 979-11-85890-32-6 (93000) 14 | 15 | [### 도서 소개 페이지 바로 가기 ###](http://jpub.tistory.com/531) 16 | 17 | 18 | -------------------------------------------------------------------------------- /README.rdoc: -------------------------------------------------------------------------------- 1 | == README 2 | 3 | This README would normally document whatever steps are necessary to get the 4 | application up and running. 5 | 6 | Things you may want to cover: 7 | 8 | * Ruby version 9 | 10 | * System dependencies 11 | 12 | * Configuration 13 | 14 | * Database creation 15 | 16 | * Database initialization 17 | 18 | * How to run the test suite 19 | 20 | * Services (job queues, cache servers, search engines, etc.) 21 | 22 | * Deployment instructions 23 | 24 | * ... 25 | 26 | 27 | Please feel free to use a different markup language if you do not plan to run 28 | rake doc:app. 29 | -------------------------------------------------------------------------------- /Rakefile: -------------------------------------------------------------------------------- 1 | # Add your own tasks in files placed in lib/tasks ending in .rake, 2 | # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. 3 | 4 | require File.expand_path('../config/application', __FILE__) 5 | 6 | Railbook::Application.load_tasks 7 | -------------------------------------------------------------------------------- /app/assets/audios/chimes.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jpub/RubyonRails4/c4bd37b9b9922f574dc64e57fc3ece48b0dc6f56/app/assets/audios/chimes.wav -------------------------------------------------------------------------------- /app/assets/audios/desktop.ini: -------------------------------------------------------------------------------- 1 | [LocalizedFileNames] 2 | chimes.wav=@%windir%\system32\mmres.dll,-700 3 | -------------------------------------------------------------------------------- /app/assets/images/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jpub/RubyonRails4/c4bd37b9b9922f574dc64e57fc3ece48b0dc6f56/app/assets/images/.keep -------------------------------------------------------------------------------- /app/assets/images/expensive.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jpub/RubyonRails4/c4bd37b9b9922f574dc64e57fc3ece48b0dc6f56/app/assets/images/expensive.gif -------------------------------------------------------------------------------- /app/assets/images/fav-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jpub/RubyonRails4/c4bd37b9b9922f574dc64e57fc3ece48b0dc6f56/app/assets/images/fav-icon.png -------------------------------------------------------------------------------- /app/assets/images/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jpub/RubyonRails4/c4bd37b9b9922f574dc64e57fc3ece48b0dc6f56/app/assets/images/favicon.ico -------------------------------------------------------------------------------- /app/assets/images/fish.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jpub/RubyonRails4/c4bd37b9b9922f574dc64e57fc3ece48b0dc6f56/app/assets/images/fish.jpg -------------------------------------------------------------------------------- /app/assets/images/wings_logo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jpub/RubyonRails4/c4bd37b9b9922f574dc64e57fc3ece48b0dc6f56/app/assets/images/wings_logo.gif -------------------------------------------------------------------------------- /app/assets/javascripts/admin/books.js.coffee: -------------------------------------------------------------------------------- 1 | # Place all the behaviors and hooks related to the matching controller here. 2 | # All this logic will automatically be available in application.js. 3 | # You can use CoffeeScript in this file: http://coffeescript.org/ 4 | -------------------------------------------------------------------------------- /app/assets/javascripts/ajax.js.coffee: -------------------------------------------------------------------------------- 1 | init = -> 2 | $('#ajax_form').on 'ajax:success', (e, data) -> 3 | $('#result').empty() 4 | $.each data, -> 5 | $('#result').append( 6 | $('
').append( 7 | $('').attr('href', 'http://www.wings.msn.to/index.php/-/A-03/' + @isbn).append(@title) 8 | ) 9 | ) 10 | 11 | $(document).ajaxStart -> 12 | $('#progress').html '통신 중...' 13 | .ajaxComplete -> 14 | $('#progress').html '' 15 | 16 | $('#slide_search').on 'ajax:success', (e, data) -> 17 | $('#result').empty() 18 | $.each data.Slideshows.Slideshow, -> 19 | $('#result').append( 20 | $('').append( 21 | $('').attr('href', @URL).append("#{@Title}(#{@Description})") 22 | ) 23 | ) 24 | 25 | 26 | $(document).ready(init) 27 | $(document).on('page:change', init) 28 | -------------------------------------------------------------------------------- /app/assets/javascripts/application.js: -------------------------------------------------------------------------------- 1 | // This is a manifest file that'll be compiled into application.js, which will include all the files 2 | // listed below. 3 | // 4 | // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts, 5 | // or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path. 6 | // 7 | // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the 8 | // compiled file. 9 | // 10 | // Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details 11 | // about supported directives. 12 | // 13 | //= require jquery 14 | //= require jquery_ujs 15 | //= require turbolinks 16 | //= require_tree . 17 | -------------------------------------------------------------------------------- /app/assets/javascripts/authors.js.coffee: -------------------------------------------------------------------------------- 1 | # Place all the behaviors and hooks related to the matching controller here. 2 | # All this logic will automatically be available in application.js. 3 | # You can use CoffeeScript in this file: http://coffeescript.org/ 4 | -------------------------------------------------------------------------------- /app/assets/javascripts/books.js.coffee: -------------------------------------------------------------------------------- 1 | # Place all the behaviors and hooks related to the matching controller here. 2 | # All this logic will automatically be available in application.js. 3 | # You can use CoffeeScript in this file: http://coffeescript.org/ 4 | -------------------------------------------------------------------------------- /app/assets/javascripts/extra.js.coffee: -------------------------------------------------------------------------------- 1 | # Place all the behaviors and hooks related to the matching controller here. 2 | # All this logic will automatically be available in application.js. 3 | # You can use CoffeeScript in this file: http://coffeescript.org/ 4 | -------------------------------------------------------------------------------- /app/assets/javascripts/fan_comments.js.coffee: -------------------------------------------------------------------------------- 1 | # Place all the behaviors and hooks related to the matching controller here. 2 | # All this logic will automatically be available in application.js. 3 | # You can use CoffeeScript in this file: http://coffeescript.org/ 4 | -------------------------------------------------------------------------------- /app/assets/javascripts/hello.js.coffee: -------------------------------------------------------------------------------- 1 | # Place all the behaviors and hooks related to the matching controller here. 2 | # All this logic will automatically be available in application.js. 3 | # You can use CoffeeScript in this file: http://coffeescript.org/ 4 | 5 | #$ -> 6 | init = -> 7 | 8 | class Sample 9 | constructor: (@name) -> 10 | result = document.getElementById 'result' 11 | result.onclick = => 12 | alert "안녕하세요. #{@name} 님!" 13 | 14 | s = new Sample('윤인성') 15 | -------------------------------------------------------------------------------- /app/assets/javascripts/members.js.coffee: -------------------------------------------------------------------------------- 1 | # Place all the behaviors and hooks related to the matching controller here. 2 | # All this logic will automatically be available in application.js. 3 | # You can use CoffeeScript in this file: http://coffeescript.org/ 4 | -------------------------------------------------------------------------------- /app/assets/javascripts/reviews.js.coffee: -------------------------------------------------------------------------------- 1 | # Place all the behaviors and hooks related to the matching controller here. 2 | # All this logic will automatically be available in application.js. 3 | # You can use CoffeeScript in this file: http://coffeescript.org/ 4 | -------------------------------------------------------------------------------- /app/assets/javascripts/users.js.coffee: -------------------------------------------------------------------------------- 1 | # Place all the behaviors and hooks related to the matching controller here. 2 | # All this logic will automatically be available in application.js. 3 | # You can use CoffeeScript in this file: http://coffeescript.org/ 4 | -------------------------------------------------------------------------------- /app/assets/stylesheets/admin/books.css.scss: -------------------------------------------------------------------------------- 1 | // Place all the styles related to the Admin::Books controller here. 2 | // They will automatically be included in application.css. 3 | // You can use Sass (SCSS) here: http://sass-lang.com/ 4 | -------------------------------------------------------------------------------- /app/assets/stylesheets/ajax.css.scss: -------------------------------------------------------------------------------- 1 | // Place all the styles related to the ajax controller here. 2 | // They will automatically be included in application.css. 3 | // You can use Sass (SCSS) here: http://sass-lang.com/ 4 | -------------------------------------------------------------------------------- /app/assets/stylesheets/application.css: -------------------------------------------------------------------------------- 1 | /* 2 | * This is a manifest file that'll be compiled into application.css, which will include all the files 3 | * listed below. 4 | * 5 | * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets, 6 | * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path. 7 | * 8 | * You're free to add application-wide styles to this file and they'll appear at the top of the 9 | * compiled file, but it's generally better to create a new file per style scope. 10 | * 11 | *= require_self 12 | *= require_tree . 13 | */ 14 | -------------------------------------------------------------------------------- /app/assets/stylesheets/authors.css.scss: -------------------------------------------------------------------------------- 1 | // Place all the styles related to the authors controller here. 2 | // They will automatically be included in application.css. 3 | // You can use Sass (SCSS) here: http://sass-lang.com/ 4 | -------------------------------------------------------------------------------- /app/assets/stylesheets/books.css.scss: -------------------------------------------------------------------------------- 1 | // Place all the styles related to the books controller here. 2 | // They will automatically be included in application.css. 3 | // You can use Sass (SCSS) here: http://sass-lang.com/ 4 | -------------------------------------------------------------------------------- /app/assets/stylesheets/extra.css.scss: -------------------------------------------------------------------------------- 1 | // Place all the styles related to the extra controller here. 2 | // They will automatically be included in application.css. 3 | // You can use Sass (SCSS) here: http://sass-lang.com/ 4 | -------------------------------------------------------------------------------- /app/assets/stylesheets/fan_comments.css.scss: -------------------------------------------------------------------------------- 1 | // Place all the styles related to the fan_comments controller here. 2 | // They will automatically be included in application.css. 3 | // You can use Sass (SCSS) here: http://sass-lang.com/ 4 | -------------------------------------------------------------------------------- /app/assets/stylesheets/hello.css.scss: -------------------------------------------------------------------------------- 1 | // Place all the styles related to the hello controller here. 2 | // They will automatically be included in application.css. 3 | // You can use Sass (SCSS) here: http://sass-lang.com/ 4 | -------------------------------------------------------------------------------- /app/assets/stylesheets/members.css.scss: -------------------------------------------------------------------------------- 1 | // Place all the styles related to the members controller here. 2 | // They will automatically be included in application.css. 3 | // You can use Sass (SCSS) here: http://sass-lang.com/ 4 | -------------------------------------------------------------------------------- /app/assets/stylesheets/reviews.css.scss: -------------------------------------------------------------------------------- 1 | // Place all the styles related to the reviews controller here. 2 | // They will automatically be included in application.css. 3 | // You can use Sass (SCSS) here: http://sass-lang.com/ 4 | -------------------------------------------------------------------------------- /app/assets/stylesheets/scaffolds.css.scss: -------------------------------------------------------------------------------- 1 | body { 2 | background-color: #fff; 3 | color: #333; 4 | font-family: verdana, arial, helvetica, sans-serif; 5 | font-size: 13px; 6 | line-height: 18px; 7 | } 8 | 9 | p, ol, ul, td { 10 | font-family: verdana, arial, helvetica, sans-serif; 11 | font-size: 13px; 12 | line-height: 18px; 13 | } 14 | 15 | pre { 16 | background-color: #eee; 17 | padding: 10px; 18 | font-size: 11px; 19 | } 20 | 21 | a { 22 | color: #000; 23 | &:visited { 24 | color: #666; 25 | } 26 | &:hover { 27 | color: #fff; 28 | background-color: #000; 29 | } 30 | } 31 | 32 | div { 33 | &.field, &.actions { 34 | margin-bottom: 10px; 35 | } 36 | } 37 | 38 | #notice { 39 | color: green; 40 | } 41 | 42 | .field_with_errors { 43 | padding: 2px; 44 | background-color: red; 45 | display: table; 46 | } 47 | 48 | #error_explanation { 49 | width: 450px; 50 | border: 2px solid red; 51 | padding: 7px; 52 | padding-bottom: 0; 53 | margin-bottom: 20px; 54 | background-color: #f0f0f0; 55 | h2 { 56 | text-align: left; 57 | font-weight: bold; 58 | padding: 5px 5px 5px 15px; 59 | font-size: 12px; 60 | margin: -7px; 61 | margin-bottom: 0px; 62 | background-color: #c00; 63 | color: #fff; 64 | } 65 | ul li { 66 | font-size: 12px; 67 | list-style: square; 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /app/assets/stylesheets/users.css.scss: -------------------------------------------------------------------------------- 1 | // Place all the styles related to the users controller here. 2 | // They will automatically be included in application.css. 3 | // You can use Sass (SCSS) here: http://sass-lang.com/ 4 | -------------------------------------------------------------------------------- /app/assets/videos/child/sample.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jpub/RubyonRails4/c4bd37b9b9922f574dc64e57fc3ece48b0dc6f56/app/assets/videos/child/sample.mp4 -------------------------------------------------------------------------------- /app/assets/videos/sample_mpeg4.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jpub/RubyonRails4/c4bd37b9b9922f574dc64e57fc3ece48b0dc6f56/app/assets/videos/sample_mpeg4.mp4 -------------------------------------------------------------------------------- /app/controllers/admin/books_controller.rb: -------------------------------------------------------------------------------- 1 | class Admin::BooksController < ApplicationController 2 | end 3 | -------------------------------------------------------------------------------- /app/controllers/ajax_controller.rb: -------------------------------------------------------------------------------- 1 | require 'net/http' 2 | 3 | class AjaxController < ApplicationController 4 | 5 | def test 6 | end 7 | 8 | def upanel 9 | @time = Time.now.to_s 10 | end 11 | 12 | def search 13 | @books = Book.select(:publish).distinct 14 | end 15 | 16 | def result 17 | sleep(2) 18 | @books = Book.where(publish: params[:publish]) 19 | end 20 | 21 | def slideshow 22 | #api_key = 'xxxxxxxx' 23 | #secret = 'xxxxxxxx' 24 | api_key = 'qPIgzUDk' 25 | secret = 'T6o6e2YU' 26 | ts = Time.now.to_i 27 | h = Digest::SHA1.hexdigest(secret + ts.to_s) 28 | render text: "https://www.slideshare.net/api/2/search_slideshows?q=Rails&lang=ko&api_key=#{api_key}&hash=#{h}&ts=#{ts}" 29 | end 30 | 31 | def search_slide 32 | #api_key = 'xxxxxxxx' 33 | #secret = 'xxxxxxxx' 34 | api_key = 'qPIgzUDk' 35 | secret = 'T6o6e2YU' 36 | ts = Time.now.to_i 37 | h = Digest::SHA1.hexdigest(secret + ts.to_s) 38 | Net::HTTP.start('www.slideshare.net', 443, 39 | use_ssl: true, ca_file: 'tmp/cacert.pem') do |https| 40 | res = https.get("/api/2/search_slideshows?q=#{ERB::Util.url_encode(params[:keywd])}&lang=ko&api_key=#{api_key}&hash=#{h}&ts=#{ts}") 41 | render json: Hash.from_xml(res.body).to_json 42 | end 43 | end 44 | 45 | end 46 | -------------------------------------------------------------------------------- /app/controllers/application_controller.rb: -------------------------------------------------------------------------------- 1 | class ApplicationController < ActionController::Base 2 | # Prevent CSRF attacks by raising an exception. 3 | # For APIs, you may want to use :null_session instead. 4 | protect_from_forgery with: :exception 5 | # before_action :check_logined 6 | # rescue_from ActiveRecord::RecordNotFound, with: :id_invalid 7 | # before_action :detect_locale 8 | # add_flash_types :info 9 | # skip_before_action :my_logging 10 | 11 | # def default_url_options(options = {}) 12 | # { locale: I18n.locale } 13 | # end 14 | 15 | private 16 | def check_logined 17 | if session[:usr] then 18 | begin 19 | @usr = User.find(session[:usr]) 20 | rescue ActiveRecord::RecordNotFound 21 | reset_session 22 | end 23 | end 24 | unless @usr 25 | flash[:referer] = request.fullpath 26 | redirect_to controller: :login, action: :index 27 | end 28 | end 29 | 30 | def id_invalid(e) 31 | render 'shared/record_not_found', status: 404 32 | end 33 | 34 | 35 | def detect_locale 36 | I18n.locale = request.headers['Accept-Language'].scan(/\A[a-z]{2}/).first 37 | # I18n.locale = params[:locale] 38 | I18n.locale = :ko 39 | end 40 | end 41 | -------------------------------------------------------------------------------- /app/controllers/authors_controller.rb: -------------------------------------------------------------------------------- 1 | class AuthorsController < ApplicationController 2 | before_action :set_author, only: [:show, :edit, :update, :destroy] 3 | 4 | # GET /authors 5 | # GET /authors.json 6 | def index 7 | @authors = Author.all 8 | end 9 | 10 | # GET /authors/1 11 | # GET /authors/1.json 12 | def show 13 | end 14 | 15 | # GET /authors/new 16 | def new 17 | @author = Author.new 18 | end 19 | 20 | # GET /authors/1/edit 21 | def edit 22 | end 23 | 24 | # POST /authors 25 | # POST /authors.json 26 | def create 27 | @author = Author.new(author_params) 28 | 29 | respond_to do |format| 30 | if @author.save 31 | format.html { redirect_to @author, notice: 'Author was successfully created.' } 32 | format.json { render action: 'show', status: :created, location: @author } 33 | else 34 | format.html { render action: 'new' } 35 | format.json { render json: @author.errors, status: :unprocessable_entity } 36 | end 37 | end 38 | end 39 | 40 | # PATCH/PUT /authors/1 41 | # PATCH/PUT /authors/1.json 42 | def update 43 | respond_to do |format| 44 | if @author.update(author_params) 45 | format.html { redirect_to @author, notice: 'Author was successfully updated.' } 46 | format.json { head :no_content } 47 | else 48 | format.html { render action: 'edit' } 49 | format.json { render json: @author.errors, status: :unprocessable_entity } 50 | end 51 | end 52 | end 53 | 54 | # DELETE /authors/1 55 | # DELETE /authors/1.json 56 | def destroy 57 | @author.destroy 58 | respond_to do |format| 59 | format.html { redirect_to authors_url } 60 | format.json { head :no_content } 61 | end 62 | end 63 | 64 | private 65 | # Use callbacks to share common setup or constraints between actions. 66 | def set_author 67 | @author = Author.find(params[:id]) 68 | end 69 | 70 | # Never trust parameters from the scary internet, only allow the white list through. 71 | def author_params 72 | params.require(:author).permit(:user_id, :name, :birth, :address, :ctype, :photo) 73 | end 74 | end 75 | -------------------------------------------------------------------------------- /app/controllers/concerns/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jpub/RubyonRails4/c4bd37b9b9922f574dc64e57fc3ece48b0dc6f56/app/controllers/concerns/.keep -------------------------------------------------------------------------------- /app/controllers/concerns/form_auth.rb: -------------------------------------------------------------------------------- 1 | module FormAuth 2 | extend ActiveSupport::Concern 3 | 4 | included do 5 | before_filter :check_logined 6 | end 7 | 8 | private 9 | def check_logined 10 | if session[:usr] then 11 | begin 12 | @usr = User.find(session[:usr]) 13 | rescue ActiveRecord::RecordNotFound 14 | reset_session 15 | end 16 | end 17 | unless @usr 18 | flash[:referer] = request.fullpath 19 | redirect_to controller: :login, action: :index 20 | end 21 | end 22 | end 23 | -------------------------------------------------------------------------------- /app/controllers/extra_controller.rb: -------------------------------------------------------------------------------- 1 | class ExtraController < ApplicationController 2 | 3 | def sendmail 4 | user = User.find(6) 5 | @mail = NoticeMailer.sendmail_confirm(user).deliver 6 | render text: '메일이 정상적으로 전송되었습니다.' 7 | end 8 | 9 | def paging 10 | @books = Book.order('published DESC'). 11 | paginate(page: params[:page], per_page: 5) 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /app/controllers/fan_comments_controller.rb: -------------------------------------------------------------------------------- 1 | class FanCommentsController < ApplicationController 2 | before_action :set_fan_comment, only: [:show, :edit, :update, :destroy] 3 | 4 | # GET /fan_comments 5 | # GET /fan_comments.json 6 | def index 7 | @fan_comments = FanComment.all 8 | end 9 | 10 | # GET /fan_comments/1 11 | # GET /fan_comments/1.json 12 | def show 13 | end 14 | 15 | # GET /fan_comments/new 16 | def new 17 | @fan_comment = FanComment.new 18 | end 19 | 20 | # GET /fan_comments/1/edit 21 | def edit 22 | end 23 | 24 | # POST /fan_comments 25 | # POST /fan_comments.json 26 | def create 27 | @fan_comment = FanComment.new(fan_comment_params) 28 | 29 | respond_to do |format| 30 | if @fan_comment.save 31 | format.html { redirect_to @fan_comment, notice: 'Fan comment was successfully created.' } 32 | format.json { render action: 'show', status: :created, location: @fan_comment } 33 | else 34 | format.html { render action: 'new' } 35 | format.json { render json: @fan_comment.errors, status: :unprocessable_entity } 36 | end 37 | end 38 | end 39 | 40 | # PATCH/PUT /fan_comments/1 41 | # PATCH/PUT /fan_comments/1.json 42 | def update 43 | respond_to do |format| 44 | if @fan_comment.update(fan_comment_params) 45 | format.html { redirect_to @fan_comment, notice: 'Fan comment was successfully updated.' } 46 | format.json { head :no_content } 47 | else 48 | format.html { render action: 'edit' } 49 | format.json { render json: @fan_comment.errors, status: :unprocessable_entity } 50 | end 51 | end 52 | end 53 | 54 | # DELETE /fan_comments/1 55 | # DELETE /fan_comments/1.json 56 | def destroy 57 | @fan_comment.destroy 58 | respond_to do |format| 59 | format.html { redirect_to fan_comments_url } 60 | format.json { head :no_content } 61 | end 62 | end 63 | 64 | private 65 | # Use callbacks to share common setup or constraints between actions. 66 | def set_fan_comment 67 | @fan_comment = FanComment.find(params[:id]) 68 | end 69 | 70 | # Never trust parameters from the scary internet, only allow the white list through. 71 | def fan_comment_params 72 | params.require(:fan_comment).permit(:author_no, :name, :body, :deleted) 73 | end 74 | end 75 | -------------------------------------------------------------------------------- /app/controllers/hello_controller.rb: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | class HelloController < ApplicationController 4 | before_action :check_logined, only: :view 5 | skip_before_action :check_logined, only: :list 6 | 7 | def index 8 | render text: 'Hello World..!' 9 | end 10 | 11 | def view 12 | @msg = 'Hello World..!' 13 | # render 'hello/special' 14 | end 15 | 16 | def list 17 | @books = Book.all 18 | end 19 | 20 | def app_var 21 | render text: MY_APP['logo']['source'] 22 | end 23 | 24 | private 25 | def check_logined 26 | if session[:usr] then 27 | 28 | begin 29 | @usr = User.find(session[:usr]) 30 | 31 | rescue ActiveRecord::RecordNotFound 32 | reset_session 33 | end 34 | end 35 | 36 | unless @usr 37 | flash[:referer] = request.fullpath 38 | redirect_to controller: :login, action: :index 39 | end 40 | end 41 | 42 | end 43 | -------------------------------------------------------------------------------- /app/controllers/login_controller.rb: -------------------------------------------------------------------------------- 1 | class LoginController < ApplicationController 2 | skip_before_action :check_logined 3 | 4 | def auth 5 | usr = User.authenticate(params[:username], params[:password]) 6 | if usr then 7 | reset_session 8 | session[:usr] = usr.id 9 | redirect_to params[:referer] 10 | else 11 | flash.now[:referer] = params[:referer] 12 | @error = '사용자 이름/비밀번호가 틀렸습니다.' 13 | render 'index' 14 | end 15 | end 16 | 17 | def logout 18 | reset_session 19 | redirect_to '/' 20 | end 21 | end 22 | -------------------------------------------------------------------------------- /app/controllers/members_controller.rb: -------------------------------------------------------------------------------- 1 | class MembersController < ApplicationController 2 | before_action :set_member, only: [:show, :edit, :update, :destroy] 3 | 4 | # GET /members 5 | # GET /members.json 6 | def index 7 | @members = Member.all 8 | end 9 | 10 | # GET /members/1 11 | # GET /members/1.json 12 | def show 13 | end 14 | 15 | # GET /members/new 16 | def new 17 | @member = Member.new 18 | end 19 | 20 | # GET /members/1/edit 21 | def edit 22 | end 23 | 24 | # POST /members 25 | # POST /members.json 26 | def create 27 | @member = Member.new(member_params) 28 | 29 | respond_to do |format| 30 | if @member.save 31 | format.html { redirect_to @member, notice: 'Member was successfully created.' } 32 | format.json { render action: 'show', status: :created, location: @member } 33 | else 34 | format.html { render action: 'new' } 35 | format.json { render json: @member.errors, status: :unprocessable_entity } 36 | end 37 | end 38 | end 39 | 40 | # PATCH/PUT /members/1 41 | # PATCH/PUT /members/1.json 42 | def update 43 | respond_to do |format| 44 | if @member.update(member_params) 45 | format.html { redirect_to @member, notice: 'Member was successfully updated.' } 46 | format.json { head :no_content } 47 | else 48 | format.html { render action: 'edit' } 49 | format.json { render json: @member.errors, status: :unprocessable_entity } 50 | end 51 | end 52 | 53 | rescue ActiveRecord::StaleObjectError 54 | render text: '충돌 오류가 발생했습니다.' 55 | 56 | end 57 | 58 | # DELETE /members/1 59 | # DELETE /members/1.json 60 | def destroy 61 | @member.destroy 62 | respond_to do |format| 63 | format.html { redirect_to members_url } 64 | format.json { head :no_content } 65 | end 66 | end 67 | 68 | private 69 | # Use callbacks to share common setup or constraints between actions. 70 | def set_member 71 | @member = Member.find(params[:id]) 72 | end 73 | 74 | # Never trust parameters from the scary internet, only allow the white list through. 75 | def member_params 76 | params.require(:member).permit(:name, :email, :lock_version) 77 | end 78 | end 79 | -------------------------------------------------------------------------------- /app/controllers/reviews_controller.rb: -------------------------------------------------------------------------------- 1 | class ReviewsController < ApplicationController 2 | before_action :set_review, only: [:show, :edit, :update, :destroy] 3 | 4 | # GET /reviews 5 | # GET /reviews.json 6 | def index 7 | @reviews = Review.all 8 | end 9 | 10 | # GET /reviews/1 11 | # GET /reviews/1.json 12 | def show 13 | end 14 | 15 | # GET /reviews/new 16 | def new 17 | @review = Review.new 18 | end 19 | 20 | # GET /reviews/1/edit 21 | def edit 22 | end 23 | 24 | # POST /reviews 25 | # POST /reviews.json 26 | def create 27 | @review = Review.new(review_params) 28 | 29 | respond_to do |format| 30 | if @review.save 31 | format.html { redirect_to @review, notice: 'Review was successfully created.' } 32 | format.json { render action: 'show', status: :created, location: @review } 33 | else 34 | format.html { render action: 'new' } 35 | format.json { render json: @review.errors, status: :unprocessable_entity } 36 | end 37 | end 38 | end 39 | 40 | # PATCH/PUT /reviews/1 41 | # PATCH/PUT /reviews/1.json 42 | def update 43 | respond_to do |format| 44 | if @review.update(review_params) 45 | format.html { redirect_to @review, notice: 'Review was successfully updated.' } 46 | format.json { head :no_content } 47 | else 48 | format.html { render action: 'edit' } 49 | format.json { render json: @review.errors, status: :unprocessable_entity } 50 | end 51 | end 52 | end 53 | 54 | # DELETE /reviews/1 55 | # DELETE /reviews/1.json 56 | def destroy 57 | @review.destroy 58 | respond_to do |format| 59 | format.html { redirect_to reviews_url } 60 | format.json { head :no_content } 61 | end 62 | end 63 | 64 | private 65 | # Use callbacks to share common setup or constraints between actions. 66 | def set_review 67 | @review = Review.find(params[:id]) 68 | end 69 | 70 | # Never trust parameters from the scary internet, only allow the white list through. 71 | def review_params 72 | params.require(:review).permit(:book_id, :user_id, :body) 73 | end 74 | end 75 | -------------------------------------------------------------------------------- /app/controllers/sample_controller.rb: -------------------------------------------------------------------------------- 1 | class SampleController < ApplicationController 2 | include FormAuth 3 | def index 4 | render text: 'Hello World..!' 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /app/controllers/users_controller.rb: -------------------------------------------------------------------------------- 1 | class UsersController < ApplicationController 2 | before_action :set_user, only: [:show, :edit, :update, :destroy] 3 | 4 | # GET /users 5 | # GET /users.json 6 | def index 7 | @users = User.all 8 | end 9 | 10 | # GET /users/1 11 | # GET /users/1.json 12 | def show 13 | end 14 | 15 | # GET /users/new 16 | def new 17 | @user = User.new 18 | end 19 | 20 | # GET /users/1/edit 21 | def edit 22 | end 23 | 24 | # POST /users 25 | # POST /users.json 26 | def create 27 | @user = User.new(user_params) 28 | 29 | respond_to do |format| 30 | if @user.save 31 | format.html { redirect_to @user, notice: 'User was successfully created.' } 32 | format.json { render action: 'show', status: :created, location: @user } 33 | else 34 | format.html { render action: 'new' } 35 | format.json { render json: @user.errors, status: :unprocessable_entity } 36 | end 37 | end 38 | end 39 | 40 | # PATCH/PUT /users/1 41 | # PATCH/PUT /users/1.json 42 | def update 43 | respond_to do |format| 44 | if @user.update(user_params) 45 | format.html { redirect_to @user, notice: 'User was successfully updated.' } 46 | format.json { head :no_content } 47 | else 48 | format.html { render action: 'edit' } 49 | format.json { render json: @user.errors, status: :unprocessable_entity } 50 | end 51 | end 52 | end 53 | 54 | # DELETE /users/1 55 | # DELETE /users/1.json 56 | def destroy 57 | @user.destroy 58 | respond_to do |format| 59 | format.html { redirect_to users_url } 60 | format.json { head :no_content } 61 | end 62 | end 63 | 64 | private 65 | # Use callbacks to share common setup or constraints between actions. 66 | def set_user 67 | @user = User.find(params[:id]) 68 | end 69 | 70 | # Never trust parameters from the scary internet, only allow the white list through. 71 | def user_params 72 | params.require(:user).permit(:username, :password, :email, :dm, :roles) 73 | # params.require(:user).permit(:username, :password, :email, :dm, :roles, :agreement) 74 | # params.require(:user).permit(:username, :password, :email, :email_confirmation, :dm, :roles, :agreement) 75 | 76 | end 77 | end 78 | -------------------------------------------------------------------------------- /app/controllers/view_controller.rb: -------------------------------------------------------------------------------- 1 | class ViewController < ApplicationController 2 | 3 | def form_tag 4 | @book = Book.new 5 | end 6 | 7 | def form_for 8 | @book = Book.new 9 | # @book = Book.find(1) 10 | end 11 | 12 | def form_for2 13 | @book = Book.new 14 | end 15 | 16 | def form_for3 17 | @book = Book.find(1) 18 | end 19 | 20 | def field 21 | @book = Book.new 22 | end 23 | 24 | def html5 25 | @book = Book.new 26 | end 27 | 28 | def col_radio 29 | @book = Book.new(publish: '제이펍') 30 | @books = Book.select(:publish).distinct 31 | end 32 | 33 | def select 34 | @book = Book.new(publish: '제이펍') 35 | end 36 | 37 | def col_select 38 | @book = Book.new(publish: '제이펍') 39 | @books = Book.select(:publish).distinct 40 | end 41 | 42 | def col_select2 43 | @book = Book.new(publish: '제이펍') 44 | @books = Book.select('DISTINCT publish') 45 | end 46 | 47 | def group_select 48 | @review = Review.new 49 | @authors = Author.all 50 | end 51 | 52 | def group_select2 53 | @review = Review.new 54 | @authors = Author.all 55 | end 56 | 57 | def dat_select 58 | @book = Book.find(1) 59 | end 60 | 61 | def fields 62 | @user = User.find(1) 63 | end 64 | 65 | def conc 66 | @books = Book.all 67 | end 68 | 69 | # def default_url_options(options = {}) 70 | # { charset: 'utf-8' } 71 | # end 72 | 73 | def adopt 74 | render layout: 'sub' 75 | end 76 | 77 | def multi 78 | render layout: 'layout' 79 | end 80 | 81 | def nest 82 | @msg = '오늘도 좋은 날씨입니다.' 83 | render layout: 'child' 84 | end 85 | 86 | def partial_basic 87 | @book = Book.find(2) 88 | end 89 | 90 | def partial_param 91 | @book = Book.find(2) 92 | end 93 | 94 | def partial_col 95 | @books = Book.all 96 | end 97 | 98 | def partial_spacer 99 | @books = Book.all 100 | end 101 | end 102 | -------------------------------------------------------------------------------- /app/helpers/admin/books_helper.rb: -------------------------------------------------------------------------------- 1 | module Admin::BooksHelper 2 | end 3 | -------------------------------------------------------------------------------- /app/helpers/ajax_helper.rb: -------------------------------------------------------------------------------- 1 | module AjaxHelper 2 | end 3 | -------------------------------------------------------------------------------- /app/helpers/application_helper.rb: -------------------------------------------------------------------------------- 1 | module ApplicationHelper 2 | end 3 | -------------------------------------------------------------------------------- /app/helpers/authors_helper.rb: -------------------------------------------------------------------------------- 1 | module AuthorsHelper 2 | end 3 | -------------------------------------------------------------------------------- /app/helpers/books_helper.rb: -------------------------------------------------------------------------------- 1 | module BooksHelper 2 | end 3 | -------------------------------------------------------------------------------- /app/helpers/extra_helper.rb: -------------------------------------------------------------------------------- 1 | module ExtraHelper 2 | def books_cache_key 3 | "books-#{Book.count}-#{Book.maximum(:updated_at).to_i}" 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /app/helpers/fan_comments_helper.rb: -------------------------------------------------------------------------------- 1 | module FanCommentsHelper 2 | end 3 | -------------------------------------------------------------------------------- /app/helpers/hello_helper.rb: -------------------------------------------------------------------------------- 1 | module HelloHelper 2 | # def format_datetime(datetime, type = :datetime) 3 | # return '' unless datetime 4 | 5 | # case type 6 | # when :datetime 7 | # format = '%Y년 %m월 %d일 %H:%M:%S' 8 | # when :date 9 | # format = '%Y년 %m월 %d일' 10 | # when :time 11 | # format = '%H:%M:%S' 12 | # end 13 | 14 | # datetime.strftime(format) 15 | #end 16 | end 17 | -------------------------------------------------------------------------------- /app/helpers/members_helper.rb: -------------------------------------------------------------------------------- 1 | module MembersHelper 2 | end 3 | -------------------------------------------------------------------------------- /app/helpers/reviews_helper.rb: -------------------------------------------------------------------------------- 1 | module ReviewsHelper 2 | end 3 | -------------------------------------------------------------------------------- /app/helpers/users_helper.rb: -------------------------------------------------------------------------------- 1 | module UsersHelper 2 | end 3 | -------------------------------------------------------------------------------- /app/helpers/view_helper.rb: -------------------------------------------------------------------------------- 1 | module ViewHelper 2 | def format_datetime(datetime, type = :datetime) 3 | 4 | return '' unless datetime 5 | 6 | case type 7 | when :datetime 8 | format = '%Y년 %m월 %d일 %H:%M:%S' 9 | when :date 10 | format = '%Y년 %m월 %d일' 11 | when :time 12 | format = '%H:%M:%S' 13 | end 14 | datetime.strftime(format) 15 | end 16 | 17 | def list_tag(collection, prop) 18 | content_tag(:ul) do 19 | collection.each do |element| 20 | concat content_tag(:li, element.attributes[prop]) 21 | end 22 | end 23 | end 24 | 25 | def list_tag2(collection, prop) 26 | list = 'User | 7 |Name | 8 |Birth | 9 |Address | 10 |Ctype | 11 |Photo | 12 |13 | | 14 | | 15 | |
---|---|---|---|---|---|---|---|---|
<%= author.user %> | 22 |<%= author.name %> | 23 |<%= author.birth %> | 24 |<%= author.address %> | 25 |<%= author.ctype %> | 26 |<%= author.photo %> | 27 |<%= link_to 'Show', author %> | 28 |<%= link_to 'Edit', edit_author_path(author) %> | 29 |<%= link_to 'Destroy', author, method: :delete, data: { confirm: 'Are you sure?' } %> | 30 |
<%= notice %>
2 | 3 |4 | User: 5 | <%= @author.user %> 6 |
7 | 8 |9 | Name: 10 | <%= @author.name %> 11 |
12 | 13 |14 | Birth: 15 | <%= @author.birth %> 16 |
17 | 18 |19 | Address: 20 | <%= @author.address %> 21 |
22 | 23 |24 | Ctype: 25 | <%= @author.ctype %> 26 |
27 | 28 |29 | Photo: 30 | <%= @author.photo %> 31 |
32 | 33 | <%= link_to 'Edit', edit_author_path(@author) %> | 34 | <%= link_to 'Back', authors_path %> 35 | -------------------------------------------------------------------------------- /app/views/authors/show.json.jbuilder: -------------------------------------------------------------------------------- 1 | json.extract! @author, :user_id, :name, :birth, :address, :ctype, :photo, :created_at, :updated_at 2 | -------------------------------------------------------------------------------- /app/views/books/_book.html.erb: -------------------------------------------------------------------------------- 1 |
2 |
3 | <%= @book.title %>
4 | <%= @book.publish %>
5 | 가격 <%= @book.price %>원
6 | ISBN <%= @book.isbn %>
7 | 출간일: <%= @book.published %>
8 |
15 | <% type = :details if type.nil? %>
16 | <% if type == :details %>
17 |
18 | <% end %>
19 | <%= book.title %>
20 | <%= book.publish %>
21 | 가격 <%= book.price %>원
22 | ISBN <%= book.isbn %>
23 | 출간일: <%= book.published %>
24 |
Isbn | 7 |Title | 8 |Price | 9 |Publish | 10 |Published | 11 |Cd | 12 |13 | | 14 | | 15 | |
---|---|---|---|---|---|---|---|---|
<%= book.isbn %> | 22 |<%= book.title %> | 23 |<%= book.price %> | 24 |<%= book.publish %> | 25 |<%= book.published %> | 26 |<%= book.cd %> | 27 |<%= link_to 'Show', book %> | 28 |<%= link_to 'Edit', edit_book_path(book) %> | 29 |<%= link_to 'Destroy', book, method: :delete, data: { confirm: 'Are you sure?' } %> | 30 |
<%= notice %><%#= flash[:msg] %><%#= info %>
2 | 3 |4 | Isbn: 5 | <%= @book.isbn %> 6 |
7 | 8 |9 | Title: 10 | <%= @book.title %> 11 |
12 | 13 |14 | Price: 15 | <%= @book.price %> 16 |
17 | 18 |19 | Publish: 20 | <%= @book.publish %> 21 |
22 | 23 |24 | Published: 25 | <%= @book.published %> 26 |
27 | 28 |29 | Cd: 30 | <%= @book.cd %> 31 |
32 | 33 | <%= link_to 'Edit', edit_book_path(@book) %> | 34 | <%= link_to 'Back', books_path %> 35 | -------------------------------------------------------------------------------- /app/views/books/show.json.jbuilder: -------------------------------------------------------------------------------- 1 | json.extract! @book, :isbn, :title, :price, :publish, :published, :cd, :created_at, :updated_at 2 | -------------------------------------------------------------------------------- /app/views/ctrl/cookie.html.erb: -------------------------------------------------------------------------------- 1 | <%= form_tag(action: :cookie_rec) do %> 2 | 4 | <%= submit_tag '저장' %> 5 | <% end %> 6 | -------------------------------------------------------------------------------- /app/views/ctrl/details_info.html.erb: -------------------------------------------------------------------------------- 1 | dummy 2 | -------------------------------------------------------------------------------- /app/views/ctrl/download.csv.ruby: -------------------------------------------------------------------------------- 1 | result = '' 2 | result << @books.attribute_names.join(',') 3 | result << "\r" 4 | 5 | @books.each do |b| 6 | result << b.attributes.values.join(',') 7 | result << "\r" 8 | end 9 | 10 | result.encode('EUC-KR') 11 | -------------------------------------------------------------------------------- /app/views/ctrl/dummy.html.erb: -------------------------------------------------------------------------------- 1 | リダイレクトの테스트 2 | <%= link_to 'リダイレクト', { controller: :ctrl, action: :redirect } %>2 | <% @book = Book.find(1) %> 3 | <%= render @book %> 4 |
5 | -------------------------------------------------------------------------------- /app/views/extra/model2.html.erb: -------------------------------------------------------------------------------- 1 | <% cache(books_cache_key) do %> 2 | <% Book.all.each do |book| %> 3 |4 | <%= render book %> 5 |
6 | <% end %> 7 | <% end %> 8 | -------------------------------------------------------------------------------- /app/views/extra/paging.html.erb: -------------------------------------------------------------------------------- 1 |ISBN 코드 | 이름 | 가격 | 4 |출판사 | 출간일 | CD | 5 |
---|---|---|---|---|---|
<%= (book.isbn) %> | 9 |<%= (book.title) %> | 10 |<%= (book.price) %> | 11 |<%= (book.publish) %> | 12 |<%= (book.published) %> | 13 |<%= (book.cd) %> | 14 |
Author no | 7 |Name | 8 |Body | 9 |Deleted | 10 |11 | | 12 | | 13 | |
---|---|---|---|---|---|---|
<%= fan_comment.author_no %> | 20 |<%= fan_comment.name %> | 21 |<%= fan_comment.body %> | 22 |<%= fan_comment.deleted %> | 23 |<%= link_to 'Show', fan_comment %> | 24 |<%= link_to 'Edit', edit_fan_comment_path(fan_comment) %> | 25 |<%= link_to 'Destroy', fan_comment, method: :delete, data: { confirm: 'Are you sure?' } %> | 26 |
<%= notice %>
2 | 3 |4 | Author no: 5 | <%= @fan_comment.author_no %> 6 |
7 | 8 |9 | Name: 10 | <%= @fan_comment.name %> 11 |
12 | 13 |14 | Body: 15 | <%= @fan_comment.body %> 16 |
17 | 18 |19 | Deleted: 20 | <%= @fan_comment.deleted %> 21 |
22 | 23 | <%= link_to 'Edit', edit_fan_comment_path(@fan_comment) %> | 24 | <%= link_to 'Back', fan_comments_path %> 25 | -------------------------------------------------------------------------------- /app/views/fan_comments/show.json.jbuilder: -------------------------------------------------------------------------------- 1 | json.extract! @fan_comment, :id, :author_no, :name, :body, :deleted, :created_at, :updated_at 2 | -------------------------------------------------------------------------------- /app/views/hello/helper.html.erb: -------------------------------------------------------------------------------- 1 | <% current = Time.now %> 2 | <%= format_datetime(current, :date) %> 3 | -------------------------------------------------------------------------------- /app/views/hello/list.html.erb: -------------------------------------------------------------------------------- 1 |ISBN 코드 | 이름 | 가격 | 4 |출판사 | 출간일 | CD-ROM | 5 |||
---|---|---|---|---|---|---|---|
<%= book.isbn %> | 17 |<%= book.title %> | 18 | 19 | <% 20 | =begin 21 | %> 22 |23 | <%= book.isbn %> | 24 |25 | <%= book.title %> | 26 | <% 27 | =end 28 | %> 29 |<%= book.price %>원 | 30 |<%= book.publish %> | 31 |<%= book.published %> | 32 |<%= book.cd %> | 33 |
<%= @error %>
2 | <%= form_tag action: :auth do %> 3 |Name | 7 |Lock version | 9 |10 | | 11 | | 12 | | |
---|---|---|---|---|---|
<%= member.name %> | 19 |<%= member.email %> | 20 |<%= member.lock_version %> | 21 |<%= link_to 'Show', member %> | 22 |<%= link_to 'Edit', edit_member_path(member) %> | 23 |<%= link_to 'Destroy', member, method: :delete, data: { confirm: 'Are you sure?' } %> | 24 |
<%= notice %>
2 | 3 |4 | Name: 5 | <%= @member.name %> 6 |
7 | 8 |9 | Email: 10 | <%= @member.email %> 11 |
12 | 13 |14 | Lock version: 15 | <%= @member.lock_version %> 16 |
17 | 18 | <%= link_to 'Edit', edit_member_path(@member) %> | 19 | <%= link_to 'Back', members_path %> 20 | -------------------------------------------------------------------------------- /app/views/members/show.json.jbuilder: -------------------------------------------------------------------------------- 1 | json.extract! @member, :name, :email, :lock_version, :created_at, :updated_at 2 | -------------------------------------------------------------------------------- /app/views/notice_mailer/sendmail_confirm.html.erb: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | <%= @user.username %>님 8 |
10 | 사이트에 사용자 등록해주셔서 감사드립니다.
11 | 다음은 등록해주신 정보입니다.
12 |
사이트 이용을 위해 <%= link_to '여기', { host: 'www.example.com', controller: :books, action: :index } %>에서 로그인해주세요.
21 | 22 | <%#= url_for(host: 'www.example.com', controller: :books, 23 | action: :index, only_path: false) %> 24 | 25 |<%= b.body %>(<%= b.title %>: <%= b.name %>)
3 | <% end %> -------------------------------------------------------------------------------- /app/views/record/assoc_join2.html.erb: -------------------------------------------------------------------------------- 1 | <% @books.each do |b| %> 2 |<%= b.body %>(<%= b.title %>)by <%= b.username %>
3 | <% end %> -------------------------------------------------------------------------------- /app/views/record/assoc_join3.html.erb: -------------------------------------------------------------------------------- 1 | <% @books.each do |b| %> 2 |<%= b.body %>(<%= b.title %>)
3 | <% end %> -------------------------------------------------------------------------------- /app/views/record/belongs.html.erb: -------------------------------------------------------------------------------- 1 |<%= @review.body %>(<%= @review.updated_at %>)
-------------------------------------------------------------------------------- /app/views/record/groupby.html.erb: -------------------------------------------------------------------------------- 1 |출판사 | 가격 | 4 |
---|---|
<%= book.publish %> | 8 |<%= book.avg_price %>원 | 9 |
출판사 | 가격 | 4 |
---|---|
<%= key %> | 8 |<%= value %>원 | 9 |
Book | 7 |User | 8 |Body | 9 |10 | | 11 | | 12 | |
---|---|---|---|---|---|
<%= review.book %> | 19 |<%= review.user %> | 20 |<%= review.body %> | 21 |<%= link_to 'Show', review %> | 22 |<%= link_to 'Edit', edit_review_path(review) %> | 23 |<%= link_to 'Destroy', review, method: :delete, data: { confirm: 'Are you sure?' } %> | 24 |
<%= notice %>
2 | 3 |4 | Book: 5 | <%= @review.book %> 6 |
7 | 8 |9 | User: 10 | <%= @review.user %> 11 |
12 | 13 |14 | Body: 15 | <%= @review.body %> 16 |
17 | 18 | <%= link_to 'Edit', edit_review_path(@review) %> | 19 | <%= link_to 'Back', reviews_path %> 20 | -------------------------------------------------------------------------------- /app/views/reviews/show.json.jbuilder: -------------------------------------------------------------------------------- 1 | json.extract! @review, :book_id, :user_id, :body, :created_at, :updated_at 2 | -------------------------------------------------------------------------------- /app/views/shared/record_not_found.html.erb: -------------------------------------------------------------------------------- 1 |요청한 URL"<%= request.fullpath %>"은 존재하지 않습니다.
-------------------------------------------------------------------------------- /app/views/users/_form.html.erb: -------------------------------------------------------------------------------- 1 | <%= form_for(@user) do |f| %> 2 | <% if @user.errors.any? %> 3 |Username | 7 |Password | 8 |Dm | 10 |Roles | 11 |12 | | 13 | | 14 | | |
---|---|---|---|---|---|---|---|
<%= user.username %> | 21 |<%= user.password %> | 22 |<%= user.email %> | 23 |<%= user.dm %> | 24 |<%= user.roles %> | 25 |<%= link_to 'Show', user %> | 26 |<%= link_to 'Edit', edit_user_path(user) %> | 27 |<%= link_to 'Destroy', user, method: :delete, data: { confirm: 'Are you sure?' } %> | 28 |
<%= notice %>
2 | 3 |4 | Username: 5 | <%= @user.username %> 6 |
7 | 8 |9 | Password: 10 | <%= @user.password %> 11 |
12 | 13 |14 | Email: 15 | <%= @user.email %> 16 |
17 | 18 |19 | Dm: 20 | <%= @user.dm %> 21 |
22 | 23 |24 | Roles: 25 | <%= @user.roles %> 26 |
27 | 28 | <%= link_to 'Edit', edit_user_path(@user) %> | 29 | <%= link_to 'Back', users_path %> 30 | -------------------------------------------------------------------------------- /app/views/users/show.json.jbuilder: -------------------------------------------------------------------------------- 1 | json.extract! @user, :username, :password, :email, :dm, :roles, :created_at, :updated_at 2 | -------------------------------------------------------------------------------- /app/views/view/_separator.html.erb: -------------------------------------------------------------------------------- 1 |ISBN 코드 | 이름 | 가격 | 4 |출판사 | 출간일 | CD-ROM | 5 ||
---|---|---|---|---|---|---|
<%= book.isbn %> | 10 |<%= book.title %> | 11 |<%= book.price %>원 12 | <% if book.price >= 30000 13 | concat image_tag 'expensive.gif' 14 | end %> 15 | | 16 | <% 17 | =begin 18 | %> 19 |<%= book.price %>원 20 | <% if book.price >= 3000 %> 21 | <%= image_tag 'expensive.gif' %> 22 | <% end %> 23 | | 24 | <% 25 | =end 26 | %> 27 |<%= book.publish %> | 28 |<%= book.published %> | 29 |<%= book.cd %> | 30 |
You may have mistyped the address or the page may have moved.
55 |If you are the application owner check the logs for more information.
57 | 58 | 59 | -------------------------------------------------------------------------------- /public/422.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |Maybe you tried to change something you didn't have access to.
55 |If you are the application owner check the logs for more information.
57 | 58 | 59 | -------------------------------------------------------------------------------- /public/500.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |If you are the application owner check the logs for more information.
56 | 57 | 58 | -------------------------------------------------------------------------------- /public/assets/application-12b3c7dd74d2e9df37e7cbb1efa76a6d.css: -------------------------------------------------------------------------------- 1 | /* 2 | * This is a manifest file that'll be compiled into application.css, which will include all the files 3 | * listed below. 4 | * 5 | * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets, 6 | * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path. 7 | * 8 | * You're free to add application-wide styles to this file and they'll appear at the top of the 9 | * compiled file, but it's generally better to create a new file per style scope. 10 | * 11 | 12 | 13 | */ 14 | 15 | body { 16 | background-color: #fff; 17 | color: #333; 18 | font-family: verdana, arial, helvetica, sans-serif; 19 | font-size: 13px; 20 | line-height: 18px; } 21 | 22 | p, ol, ul, td { 23 | font-family: verdana, arial, helvetica, sans-serif; 24 | font-size: 13px; 25 | line-height: 18px; } 26 | 27 | pre { 28 | background-color: #eee; 29 | padding: 10px; 30 | font-size: 11px; } 31 | 32 | a { 33 | color: #000; } 34 | a:visited { 35 | color: #666; } 36 | a:hover { 37 | color: #fff; 38 | background-color: #000; } 39 | 40 | div.field, div.actions { 41 | margin-bottom: 10px; } 42 | 43 | #notice { 44 | color: green; } 45 | 46 | .field_with_errors { 47 | padding: 2px; 48 | background-color: red; 49 | display: table; } 50 | 51 | #error_explanation { 52 | width: 450px; 53 | border: 2px solid red; 54 | padding: 7px; 55 | padding-bottom: 0; 56 | margin-bottom: 20px; 57 | background-color: #f0f0f0; } 58 | #error_explanation h2 { 59 | text-align: left; 60 | font-weight: bold; 61 | padding: 5px 5px 5px 15px; 62 | font-size: 12px; 63 | margin: -7px; 64 | margin-bottom: 0px; 65 | background-color: #c00; 66 | color: #fff; } 67 | #error_explanation ul li { 68 | font-size: 12px; 69 | list-style: square; } 70 | -------------------------------------------------------------------------------- /public/assets/application-12b3c7dd74d2e9df37e7cbb1efa76a6d.css.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jpub/RubyonRails4/c4bd37b9b9922f574dc64e57fc3ece48b0dc6f56/public/assets/application-12b3c7dd74d2e9df37e7cbb1efa76a6d.css.gz -------------------------------------------------------------------------------- /public/assets/application-89263912e8385765bd57cd2fa026dd0e.js.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jpub/RubyonRails4/c4bd37b9b9922f574dc64e57fc3ece48b0dc6f56/public/assets/application-89263912e8385765bd57cd2fa026dd0e.js.gz -------------------------------------------------------------------------------- /public/assets/chimes-29587febd995cdd099fcb2a3a888f0d3.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jpub/RubyonRails4/c4bd37b9b9922f574dc64e57fc3ece48b0dc6f56/public/assets/chimes-29587febd995cdd099fcb2a3a888f0d3.wav -------------------------------------------------------------------------------- /public/assets/desktop-3c57fbf7ddab44ab42ceb3c723e4c36e.ini: -------------------------------------------------------------------------------- 1 | [LocalizedFileNames] 2 | chimes.wav=@%windir%\system32\mmres.dll,-700 3 | -------------------------------------------------------------------------------- /public/assets/fav-icon-91e6ea59f2dd4774bccce741269d5c32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jpub/RubyonRails4/c4bd37b9b9922f574dc64e57fc3ece48b0dc6f56/public/assets/fav-icon-91e6ea59f2dd4774bccce741269d5c32.png -------------------------------------------------------------------------------- /public/assets/favicon-f25e19e103e8db47bb74fefd2dc2bdf1.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jpub/RubyonRails4/c4bd37b9b9922f574dc64e57fc3ece48b0dc6f56/public/assets/favicon-f25e19e103e8db47bb74fefd2dc2bdf1.ico -------------------------------------------------------------------------------- /public/assets/manifest-aa873fb3633eb11c3c0c2dd1fb243c1e.json: -------------------------------------------------------------------------------- 1 | {"files":{"chimes-29587febd995cdd099fcb2a3a888f0d3.wav":{"logical_path":"chimes.wav","mtime":"2009-06-11T06:22:40+09:00","size":216364,"digest":"29587febd995cdd099fcb2a3a888f0d3"},"desktop-3c57fbf7ddab44ab42ceb3c723e4c36e.ini":{"logical_path":"desktop.ini","mtime":"2011-01-25T15:13:50+09:00","size":68,"digest":"3c57fbf7ddab44ab42ceb3c723e4c36e"},"fav-icon-91e6ea59f2dd4774bccce741269d5c32.png":{"logical_path":"fav-icon.png","mtime":"2011-01-25T21:23:50+09:00","size":756,"digest":"91e6ea59f2dd4774bccce741269d5c32"},"favicon-f25e19e103e8db47bb74fefd2dc2bdf1.ico":{"logical_path":"favicon.ico","mtime":"2006-11-06T00:00:00+09:00","size":2238,"digest":"f25e19e103e8db47bb74fefd2dc2bdf1"},"application-89263912e8385765bd57cd2fa026dd0e.js":{"logical_path":"application.js","mtime":"2013-10-30T15:37:30+09:00","size":289703,"digest":"89263912e8385765bd57cd2fa026dd0e"},"application-12b3c7dd74d2e9df37e7cbb1efa76a6d.css":{"logical_path":"application.css","mtime":"2013-09-25T15:00:48+09:00","size":1560,"digest":"12b3c7dd74d2e9df37e7cbb1efa76a6d"}},"assets":{"chimes.wav":"chimes-29587febd995cdd099fcb2a3a888f0d3.wav","desktop.ini":"desktop-3c57fbf7ddab44ab42ceb3c723e4c36e.ini","fav-icon.png":"fav-icon-91e6ea59f2dd4774bccce741269d5c32.png","favicon.ico":"favicon-f25e19e103e8db47bb74fefd2dc2bdf1.ico","application.js":"application-89263912e8385765bd57cd2fa026dd0e.js","application.css":"application-12b3c7dd74d2e9df37e7cbb1efa76a6d.css"}} -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jpub/RubyonRails4/c4bd37b9b9922f574dc64e57fc3ece48b0dc6f56/public/favicon.ico -------------------------------------------------------------------------------- /public/icons/Thumbs.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jpub/RubyonRails4/c4bd37b9b9922f574dc64e57fc3ece48b0dc6f56/public/icons/Thumbs.db -------------------------------------------------------------------------------- /public/icons/button.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jpub/RubyonRails4/c4bd37b9b9922f574dc64e57fc3ece48b0dc6f56/public/icons/button.gif -------------------------------------------------------------------------------- /public/robots.txt: -------------------------------------------------------------------------------- 1 | # See http://www.robotstxt.org/wc/norobots.html for documentation on how to use the robots.txt file 2 | # 3 | # To ban all spiders from the entire site uncomment the next two lines: 4 | # User-agent: * 5 | # Disallow: / 6 | -------------------------------------------------------------------------------- /test/controllers/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jpub/RubyonRails4/c4bd37b9b9922f574dc64e57fc3ece48b0dc6f56/test/controllers/.keep -------------------------------------------------------------------------------- /test/controllers/admin/books_controller_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class Admin::BooksControllerTest < ActionController::TestCase 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /test/controllers/ajax_controller_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class AjaxControllerTest < ActionController::TestCase 4 | test "should get test" do 5 | get :test 6 | assert_response :success 7 | end 8 | 9 | end 10 | -------------------------------------------------------------------------------- /test/controllers/authors_controller_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class AuthorsControllerTest < ActionController::TestCase 4 | setup do 5 | @author = authors(:one) 6 | end 7 | 8 | test "should get index" do 9 | get :index 10 | assert_response :success 11 | assert_not_nil assigns(:authors) 12 | end 13 | 14 | test "should get new" do 15 | get :new 16 | assert_response :success 17 | end 18 | 19 | test "should create author" do 20 | assert_difference('Author.count') do 21 | post :create, author: { address: @author.address, birth: @author.birth, ctype: @author.ctype, name: @author.name, photo: @author.photo, user_id: @author.user_id } 22 | end 23 | 24 | assert_redirected_to author_path(assigns(:author)) 25 | end 26 | 27 | test "should show author" do 28 | get :show, id: @author 29 | assert_response :success 30 | end 31 | 32 | test "should get edit" do 33 | get :edit, id: @author 34 | assert_response :success 35 | end 36 | 37 | test "should update author" do 38 | patch :update, id: @author, author: { address: @author.address, birth: @author.birth, ctype: @author.ctype, name: @author.name, photo: @author.photo, user_id: @author.user_id } 39 | assert_redirected_to author_path(assigns(:author)) 40 | end 41 | 42 | test "should destroy author" do 43 | assert_difference('Author.count', -1) do 44 | delete :destroy, id: @author 45 | end 46 | 47 | assert_redirected_to authors_path 48 | end 49 | end 50 | -------------------------------------------------------------------------------- /test/controllers/books_controller_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class BooksControllerTest < ActionController::TestCase 4 | =begin 5 | test "diff check" do 6 | assert_difference 'Book.count', 1 do 7 | post :create, book: { isbn: '978-4-7741-4223-0', 8 | title: 'Rubyポケットリファレンス', price: 3000, 9 | publish: '제이펍' } 10 | end 11 | end 12 | =end 13 | 14 | 15 | =begin 16 | setup do 17 | @book = books(:one) 18 | end 19 | 20 | test "should get index" do 21 | get :index 22 | assert_response :success 23 | assert_not_nil assigns(:books) 24 | end 25 | 26 | test "should get new" do 27 | get :new 28 | assert_response :success 29 | end 30 | 31 | test "should create book" do 32 | assert_difference('Book.count') do 33 | post :create, book: { cd: @book.cd, isbn: @book.isbn, price: @book.price, publish: @book.publish, published: @book.published, title: @book.title } 34 | end 35 | 36 | assert_redirected_to book_path(assigns(:book)) 37 | end 38 | 39 | test "should show book" do 40 | get :show, id: @book 41 | assert_response :success 42 | end 43 | 44 | test "should get edit" do 45 | get :edit, id: @book 46 | assert_response :success 47 | end 48 | 49 | test "should update book" do 50 | patch :update, id: @book, book: { cd: @book.cd, isbn: @book.isbn, price: @book.price, publish: @book.publish, published: @book.published, title: @book.title } 51 | assert_redirected_to book_path(assigns(:book)) 52 | end 53 | 54 | test "should destroy book" do 55 | assert_difference('Book.count', -1) do 56 | delete :destroy, id: @book 57 | end 58 | 59 | assert_redirected_to books_path 60 | end 61 | =end 62 | end 63 | -------------------------------------------------------------------------------- /test/controllers/extra_controller_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class ExtraControllerTest < ActionController::TestCase 4 | test "should get sendmail" do 5 | get :sendmail 6 | assert_response :success 7 | end 8 | 9 | end 10 | -------------------------------------------------------------------------------- /test/controllers/fan_comments_controller_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class FanCommentsControllerTest < ActionController::TestCase 4 | setup do 5 | @fan_comment = fan_comments(:one) 6 | end 7 | 8 | test "should get index" do 9 | get :index 10 | assert_response :success 11 | assert_not_nil assigns(:fan_comments) 12 | end 13 | 14 | test "should get new" do 15 | get :new 16 | assert_response :success 17 | end 18 | 19 | test "should create fan_comment" do 20 | assert_difference('FanComment.count') do 21 | post :create, fan_comment: { author_no: @fan_comment.author_no, body: @fan_comment.body, deleted: @fan_comment.deleted, name: @fan_comment.name } 22 | end 23 | 24 | assert_redirected_to fan_comment_path(assigns(:fan_comment)) 25 | end 26 | 27 | test "should show fan_comment" do 28 | get :show, id: @fan_comment 29 | assert_response :success 30 | end 31 | 32 | test "should get edit" do 33 | get :edit, id: @fan_comment 34 | assert_response :success 35 | end 36 | 37 | test "should update fan_comment" do 38 | patch :update, id: @fan_comment, fan_comment: { author_no: @fan_comment.author_no, body: @fan_comment.body, deleted: @fan_comment.deleted, name: @fan_comment.name } 39 | assert_redirected_to fan_comment_path(assigns(:fan_comment)) 40 | end 41 | 42 | test "should destroy fan_comment" do 43 | assert_difference('FanComment.count', -1) do 44 | delete :destroy, id: @fan_comment 45 | end 46 | 47 | assert_redirected_to fan_comments_path 48 | end 49 | end 50 | -------------------------------------------------------------------------------- /test/controllers/hello_controller_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class HelloControllerTest < ActionController::TestCase 4 | 5 | test "list action" do 6 | get :list 7 | assert_equal 10, assigns(:books).length, 'found rows is wrong.' 8 | assert_response :success, 'list action failed.' 9 | assert_template 'hello/list' 10 | end 11 | 12 | 13 | =begin 14 | test "routing check" do 15 | assert_generates('hello/list', 16 | { controller: 'hello', action: 'list' }) 17 | # assert_recognizes({ controller: 'hello', action: 'list' }, 'hello/list') 18 | end 19 | =end 20 | 21 | =begin 22 | test "select check" do 23 | get :list 24 | assert_select 'title' 25 | assert_select 'title', true 26 | assert_select 'font', false 27 | assert_select 'title', 'Railbook' 28 | assert_select 'title', /[A-Za-z0-9]+/ 29 | assert_select 'script[data-turbolinks-track=?]', /.+/ 30 | assert_select 'table tr[style]', 10 31 | assert_select 'table' do 32 | assert_select 'tr[style]', 1..10 33 | end 34 | assert_select 'title', { count: 1, text: 'Railbook' } 35 | end 36 | =end 37 | 38 | end 39 | -------------------------------------------------------------------------------- /test/controllers/members_controller_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class MembersControllerTest < ActionController::TestCase 4 | setup do 5 | @member = members(:one) 6 | end 7 | 8 | test "should get index" do 9 | get :index 10 | assert_response :success 11 | assert_not_nil assigns(:members) 12 | end 13 | 14 | test "should get new" do 15 | get :new 16 | assert_response :success 17 | end 18 | 19 | test "should create member" do 20 | assert_difference('Member.count') do 21 | post :create, member: { email: @member.email, lock_version: @member.lock_version, name: @member.name } 22 | end 23 | 24 | assert_redirected_to member_path(assigns(:member)) 25 | end 26 | 27 | test "should show member" do 28 | get :show, id: @member 29 | assert_response :success 30 | end 31 | 32 | test "should get edit" do 33 | get :edit, id: @member 34 | assert_response :success 35 | end 36 | 37 | test "should update member" do 38 | patch :update, id: @member, member: { email: @member.email, lock_version: @member.lock_version, name: @member.name } 39 | assert_redirected_to member_path(assigns(:member)) 40 | end 41 | 42 | test "should destroy member" do 43 | assert_difference('Member.count', -1) do 44 | delete :destroy, id: @member 45 | end 46 | 47 | assert_redirected_to members_path 48 | end 49 | end 50 | -------------------------------------------------------------------------------- /test/controllers/reviews_controller_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class ReviewsControllerTest < ActionController::TestCase 4 | setup do 5 | @review = reviews(:one) 6 | end 7 | 8 | test "should get index" do 9 | get :index 10 | assert_response :success 11 | assert_not_nil assigns(:reviews) 12 | end 13 | 14 | test "should get new" do 15 | get :new 16 | assert_response :success 17 | end 18 | 19 | test "should create review" do 20 | assert_difference('Review.count') do 21 | post :create, review: { body: @review.body, book_id: @review.book_id, user_id: @review.user_id } 22 | end 23 | 24 | assert_redirected_to review_path(assigns(:review)) 25 | end 26 | 27 | test "should show review" do 28 | get :show, id: @review 29 | assert_response :success 30 | end 31 | 32 | test "should get edit" do 33 | get :edit, id: @review 34 | assert_response :success 35 | end 36 | 37 | test "should update review" do 38 | patch :update, id: @review, review: { body: @review.body, book_id: @review.book_id, user_id: @review.user_id } 39 | assert_redirected_to review_path(assigns(:review)) 40 | end 41 | 42 | test "should destroy review" do 43 | assert_difference('Review.count', -1) do 44 | delete :destroy, id: @review 45 | end 46 | 47 | assert_redirected_to reviews_path 48 | end 49 | end 50 | -------------------------------------------------------------------------------- /test/controllers/users_controller_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class UsersControllerTest < ActionController::TestCase 4 | setup do 5 | @user = users(:one) 6 | end 7 | 8 | test "should get index" do 9 | get :index 10 | assert_response :success 11 | assert_not_nil assigns(:users) 12 | end 13 | 14 | test "should get new" do 15 | get :new 16 | assert_response :success 17 | end 18 | 19 | test "should create user" do 20 | assert_difference('User.count') do 21 | post :create, user: { dm: @user.dm, email: @user.email, password: @user.password, roles: @user.roles, username: @user.username } 22 | end 23 | 24 | assert_redirected_to user_path(assigns(:user)) 25 | end 26 | 27 | test "should show user" do 28 | get :show, id: @user 29 | assert_response :success 30 | end 31 | 32 | test "should get edit" do 33 | get :edit, id: @user 34 | assert_response :success 35 | end 36 | 37 | test "should update user" do 38 | patch :update, id: @user, user: { dm: @user.dm, email: @user.email, password: @user.password, roles: @user.roles, username: @user.username } 39 | assert_redirected_to user_path(assigns(:user)) 40 | end 41 | 42 | test "should destroy user" do 43 | assert_difference('User.count', -1) do 44 | delete :destroy, id: @user 45 | end 46 | 47 | assert_redirected_to users_path 48 | end 49 | end 50 | -------------------------------------------------------------------------------- /test/fixtures/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jpub/RubyonRails4/c4bd37b9b9922f574dc64e57fc3ece48b0dc6f56/test/fixtures/.keep -------------------------------------------------------------------------------- /test/fixtures/authors.yml: -------------------------------------------------------------------------------- 1 | # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html 2 | 3 | rint: 4 | id: 1 5 | user_id: 1 6 | name: 윤인성 7 | birth: 1991-12-09 8 | address: 서울특별시 강서구 9 | 10 | hasrat: 11 | id: 2 12 | user_id: 2 13 | name: 연하진 14 | birth: 1991-02-14 15 | address: 서울특별시 강서구 16 | 17 | iana: 18 | id: 3 19 | user_id: 3 20 | name: 김연화 21 | birth: 1989-10-15 22 | address: 서울특별시 마포구 23 | -------------------------------------------------------------------------------- /test/fixtures/authors_books.yml: -------------------------------------------------------------------------------- 1 | # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html 2 | 3 | modernjava: 4 | book_id: 1 5 | author_id: 1 6 | 7 | jslib: 8 | book_id: 2 9 | author_id: 1 10 | 11 | jslib_2: 12 | book_id: 2 13 | author_id: 2 14 | 15 | rails: 16 | book_id: 3 17 | author_id: 2 18 | 19 | sql: 20 | book_id: 4 21 | author_id: 2 22 | 23 | android: 24 | book_id: 5 25 | author_id: 1 26 | 27 | php: 28 | book_id: 6 29 | author_id: 3 30 | 31 | html: 32 | book_id: 7 33 | author_id: 3 34 | 35 | refhtml: 36 | book_id: 8 37 | author_id: 1 38 | 39 | servlet: 40 | book_id: 9 41 | author_id: 1 42 | 43 | iphone: 44 | book_id: 10 45 | author_id: 3 46 | -------------------------------------------------------------------------------- /test/fixtures/books.yml: -------------------------------------------------------------------------------- 1 | # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html 2 | 3 | modernjava: 4 | id: 1 5 | isbn: 978-4-7741-5878-5 6 | title: 안드로이드 개발자를 위한 자바 7 | price: 33600 8 | publish: 제이펍 9 | published: 2013-08-20 10 | cd: false 11 | 12 | jslib: 13 | id: 2 14 | isbn: 978-4-7741-5611-8 15 | title: 자바스크립트 라이브러리 실전 활용 16 | price: 27090 17 | publish: 제이펍 18 | published: 2013-03-19 19 | cd: false 20 | 21 | rails: 22 | id: 3 23 | isbn: 978-4-7741-4980-6 24 | title: Ruby on Rails 4 포켓 레퍼런스 25 | price: 29190 26 | publish: 제이펍 27 | published: 2012-01-26 28 | cd: true 29 | 30 | sql: 31 | id: 4 32 | isbn: 978-4-8222-9621-6 33 | title: 함께 공부하는 SQL 34 | price: 23100 35 | publish: 인사이트 36 | published: 2013-04-22 37 | cd: true 38 | 39 | android: 40 | id: 5 41 | isbn: 978-4-7980-3585-7 42 | title: 처음 시작하는 안드로이드 애플리케이션 개발 43 | price: 31500 44 | publish: 한빛아카데미 45 | published: 2012-11-22 46 | cd: false 47 | 48 | php: 49 | id: 6 50 | isbn: 978-4-7981-2631-9 51 | title: 10일 만에 살펴보는 PHP 입문 교실 52 | price: 33600 53 | publish: 한빛미디어 54 | published: 2012-09-13 55 | cd: true 56 | 57 | html: 58 | id: 7 59 | isbn: 987-4-8222-9612-4 60 | title: HTML5 애플리케이션 개발 입문 61 | price: 19950 62 | publish: 인사이트 63 | published: 2012-06-07 64 | cd: false 65 | 66 | refhtml: 67 | id: 8 68 | isbn: 978-4-7741-5067-3 69 | title: HTML5 개발 포켓 레퍼런스 70 | price: 27090 71 | publish: 한빛미디어 72 | published: 2012-04-17 73 | cd: false 74 | 75 | servlet: 76 | id: 9 77 | isbn: 978-4-7981-3049-1 78 | title: 혼자 공부하는 Java 서버 사이드 개발 79 | price: 37800 80 | publish: 한빛미디어 81 | published: 2013-01-28 82 | cd: false 83 | 84 | iphone: 85 | id: 10 86 | isbn: 978-4-88337-774-9 87 | title: Flash CS를 사용한 iPhone 프로그래밍 88 | price: 26250 89 | publish: 길벗 90 | published: 2011-08-16 91 | cd: false -------------------------------------------------------------------------------- /test/fixtures/fan_comments.yml: -------------------------------------------------------------------------------- 1 | # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html 2 | 3 | one: 4 | author_no: 1 5 | name: 윤명월 6 | body: 친절하게 설명해줘서 좋았어요! 7 | deleted: true 8 | 9 | two: 10 | author_no: 1 11 | name: 남기주 12 | body: 기초부터 차근차근 알려주는 책인 것 같아요. 13 | deleted: false 14 | 15 | three: 16 | author_no: 2 17 | name: 연하진 18 | body: 서로 대화하는듯한 설명이 마음에 들었어요. 19 | deleted: false -------------------------------------------------------------------------------- /test/fixtures/members.yml: -------------------------------------------------------------------------------- 1 | # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html 2 | 3 | one: 4 | id: 1 5 | name: 윤인성 6 | email: testA@test.com 7 | lock_version: 0 8 | 9 | two: 10 | id: 2 11 | name: 연하진 12 | email: testB@test.com 13 | lock_version: 0 14 | 15 | 16 | three: 17 | id: 3 18 | name: 김연화 19 | email: testH@test.com 20 | lock_version: 0 21 | -------------------------------------------------------------------------------- /test/fixtures/notice_mailer/sendmail_confirm: -------------------------------------------------------------------------------- 1 | nkakeyaさま 2 | 3 | この度は、本サイトへユーザ등록をいただきましてありがとうございました。 4 | 以下は、등록いただいたユーザ情報です。 5 | 6 | 사용자 이름: nkakeya 7 | 비밀번호: (セキュリティ保護のため、伏せています) 8 | 메일 주소: testG@test.com 9 | 10 | サイトをご利用いただくには、以下のページから로그인を行ってください。 11 | http://www.example.com/books 12 | 13 | 14 | "サーバサイド技術の学び舎"事務局(webmaster@wings.msn.to) 15 | -------------------------------------------------------------------------------- /test/fixtures/reviews.yml: -------------------------------------------------------------------------------- 1 | # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html 2 | 3 | modernjava_1: 4 | id: 1 5 | book_id: 1 6 | user_id: 2 7 | body: Android 개발을 할 것이라면 꼭 읽었으면 좋겠어요! 8 | 9 | modernjava_2: 10 | id: 2 11 | book_id: 1 12 | user_id: 3 13 | body: Java 기본을 다시 살펴보고 싶을 때마다 펴보고 있는 책이에요. 14 | 15 | jslib_1: 16 | id: 3 17 | book_id: 2 18 | user_id: 2 19 | body: 굉장히 유용합니다. 다양한 라이브러리를 소개해줍니다. 20 | 21 | jslib_2: 22 | id: 4 23 | book_id: 2 24 | user_id: 4 25 | body: 친절한 설명에 예제도 많아서 좋습니다. 26 | 27 | jslib_3: 28 | id: 5 29 | book_id: 2 30 | user_id: 5 31 | body: 초보자에게는 조금 어려울 수 있을 것 같습니다. 32 | 33 | rails_1: 34 | id: 6 35 | book_id: 3 36 | user_id: 1 37 | body: 그림과 예제가 많아서 초보자인 저도 쉽게 이해할 수 있었어요! 38 | 39 | rails_2: 40 | id: 7 41 | book_id: 3 42 | user_id: 1 43 | body: 내용이 좋습니다. 44 | 45 | sql: 46 | id: 8 47 | book_id: 4 48 | user_id: 5 49 | body: 데이터베이스를 처음 공부해서 조금 어려웠지만 이제 잘 사용할 수 있을 것 같아요! 50 | 51 | android: 52 | id: 9 53 | book_id: 5 54 | user_id: 3 55 | body: 기초부터 응용까지 모두 다루어주고 있습니다. 이 책 한 권으로도 안드로이드 개발을 끝낼 수 있을 것 같아요. 56 | 57 | -------------------------------------------------------------------------------- /test/fixtures/users.yml: -------------------------------------------------------------------------------- 1 | # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html 2 | 3 | arint: 4 | id: 1 5 | username: arint 6 | password: 2cf00a11121ad260ed32b290f9aefa01279bd5a2 7 | salt: 5f90a188468f64998c5a 8 | email: testA@test.com 9 | dm: true 10 | roles: admin,manager 11 | reviews_count: 2 12 | 13 | hasat: 14 | id: 2 15 | username: hasat 16 | password: 9be7f45387af4f7bbe720d16a6f334503b5c4f81 17 | salt: 5f90a188468f64998c5b 18 | email: testD@test.com 19 | dm: false 20 | roles: admin 21 | reviews_count: 2 22 | 23 | hiana: 24 | id: 3 25 | username: hiana 26 | password: 6cc09597819748465c6a2603a6f7a52d51eb01ef 27 | salt: 5f90a188468f64998c5c 28 | email: testE@test.com 29 | dm: true 30 | roles: manager 31 | reviews_count: 2 32 | 33 | rant: 34 | id: 4 35 | username: rant 36 | password: 06780c9b144eaf8dc0c8c6ded18afb032cac9b5e 37 | salt: 5f90a188468f64998c5d 38 | email: testF@test.com 39 | dm: false 40 | roles: member 41 | reviews_count: 1 42 | 43 | gurum: 44 | id: 5 45 | username: gurum 46 | password: 088aac29e5ea1bfd8879eaf3b621bdd3d31f072e 47 | salt: 5f90a188468f64998c5e 48 | email: testG@test.com 49 | dm: true 50 | roles: member 51 | reviews_count: 2 52 | 53 | nkakeya: 54 | id: 6 55 | username: nkakeya 56 | password: c599f512c00d8bbb9fd883f28b9555213516f88e 57 | salt: 5f90a188468f64998c5f 58 | email: testG@test.com 59 | dm: true 60 | roles: manager,member 61 | reviews_count: 0 62 | -------------------------------------------------------------------------------- /test/helpers/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jpub/RubyonRails4/c4bd37b9b9922f574dc64e57fc3ece48b0dc6f56/test/helpers/.keep -------------------------------------------------------------------------------- /test/helpers/admin/books_helper_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class Admin::BooksHelperTest < ActionView::TestCase 4 | end 5 | -------------------------------------------------------------------------------- /test/helpers/ajax_helper_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class AjaxHelperTest < ActionView::TestCase 4 | end 5 | -------------------------------------------------------------------------------- /test/helpers/authors_helper_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class AuthorsHelperTest < ActionView::TestCase 4 | end 5 | -------------------------------------------------------------------------------- /test/helpers/books_helper_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class BooksHelperTest < ActionView::TestCase 4 | end 5 | -------------------------------------------------------------------------------- /test/helpers/extra_helper_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class ExtraHelperTest < ActionView::TestCase 4 | end 5 | -------------------------------------------------------------------------------- /test/helpers/fan_comments_helper_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class FanCommentsHelperTest < ActionView::TestCase 4 | end 5 | -------------------------------------------------------------------------------- /test/helpers/hello_helper_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class HelloHelperTest < ActionView::TestCase 4 | end 5 | -------------------------------------------------------------------------------- /test/helpers/members_helper_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class MembersHelperTest < ActionView::TestCase 4 | end 5 | -------------------------------------------------------------------------------- /test/helpers/reviews_helper_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class ReviewsHelperTest < ActionView::TestCase 4 | end 5 | -------------------------------------------------------------------------------- /test/helpers/users_helper_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class UsersHelperTest < ActionView::TestCase 4 | end 5 | -------------------------------------------------------------------------------- /test/helpers/view_helper_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class ViewHelperTest < ActionView::TestCase 4 | test "format helper" do 5 | result = format_datetime(Time.now, :date) 6 | assert_match /\d{4}년 \d{1,2}월 \d{1,2}/, result 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /test/integration/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jpub/RubyonRails4/c4bd37b9b9922f574dc64e57fc3ece48b0dc6f56/test/integration/.keep -------------------------------------------------------------------------------- /test/integration/admin_login_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class AdminLoginTest < ActionDispatch::IntegrationTest 4 | test "login test" do 5 | get '/hello/view' 6 | assert_response :redirect 7 | assert_redirected_to controller: :login, action: :index 8 | assert_equal '/hello/view', flash[:referer] 9 | 10 | follow_redirect! 11 | assert_response :success 12 | assert_equal '/hello/view', flash[:referer] 13 | 14 | post '/login/auth', { username: 'arint', password: '12345', 15 | referer: '/hello/view' } 16 | assert_response :redirect 17 | assert_redirected_to controller: :hello, action: :view 18 | assert_equal users(:arint).id, session[:usr] 19 | 20 | follow_redirect! 21 | assert_response :success 22 | 23 | # post_via_redirect '/login/auth', { username: 'arint', 24 | # password: '12345', referer: '/hello/view' } 25 | # assert_response :success 26 | end 27 | end 28 | -------------------------------------------------------------------------------- /test/mailers/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jpub/RubyonRails4/c4bd37b9b9922f574dc64e57fc3ece48b0dc6f56/test/mailers/.keep -------------------------------------------------------------------------------- /test/mailers/notice_mailer_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class NoticeMailerTest < ActionMailer::TestCase 4 | test "sendmail_confirm" do 5 | user = User.find(6) 6 | mail = NoticeMailer.sendmail_confirm(user).deliver 7 | assert !ActionMailer::Base.deliveries.empty? 8 | assert_equal "사용자 등록 감사드립니다!", mail.subject 9 | assert_equal "testG@test.com", mail.to[0] 10 | assert_equal "webmaster@wings.msn.to", mail.from[0] 11 | assert_equal read_fixture('sendmail_confirm').join, mail.body.to_s 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /test/models/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jpub/RubyonRails4/c4bd37b9b9922f574dc64e57fc3ece48b0dc6f56/test/models/.keep -------------------------------------------------------------------------------- /test/models/author_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class AuthorTest < ActiveSupport::TestCase 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /test/models/book_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class BookTest < ActiveSupport::TestCase 4 | test "book save" do 5 | book = Book.new({ 6 | isbn: '978-4-7741-4466-X', 7 | title: 'Ruby on Rails 입문', 8 | price: 3100, 9 | publish: '제이펍', 10 | published: '2014-02-14', 11 | cd: false 12 | }) 13 | assert book.save, 'Failed to save' 14 | end 15 | 16 | =begin 17 | test "book validate" do 18 | book = Book.new({ 19 | isbn: '978-4-7741-44', 20 | title: 'Ruby on Rails 입문', 21 | price: 3100, 22 | publish: '제이펍', 23 | published: '2014-02-14', 24 | cd: false 25 | }) 26 | assert !book.save, 'Failed to validate' 27 | assert_equal book.errors.size, 2, 'Failed to validate count' 28 | assert book.errors[:isbn].any?, 'Failed to isbn validate' 29 | end 30 | =end 31 | 32 | =begin 33 | test "where method test" do 34 | result = Book.find_by(title: '자바스크립트 라이브러리 실전 활용') 35 | assert_instance_of Book, result ,'result is not instance of Book' 36 | assert_equal books(:jslib).isbn, result.isbn, 'isbn column is wrong.' 37 | assert_equal Date.new(2013, 03, 19), result.published, 38 | 'published column is wrong.' 39 | end 40 | =end 41 | 42 | =begin 43 | def setup 44 | @b = books(:jslib) 45 | end 46 | 47 | def teardown 48 | @b = nil 49 | end 50 | 51 | test "where method test" do 52 | result = Book.find_by(title: '자바스크립트 라이브러리 실전 활용') 53 | assert_instance_of Book, result ,'result is not instance of Book' 54 | assert_equal @b.isbn, result.isbn, 'isbn column is wrong.' 55 | assert_equal @b.published, result.published, 'published column is wrong.' 56 | end 57 | =end 58 | 59 | end 60 | -------------------------------------------------------------------------------- /test/models/fan_comment_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class FanCommentTest < ActiveSupport::TestCase 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /test/models/member_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class MemberTest < ActiveSupport::TestCase 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /test/models/memo_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class MemoTest < ActiveSupport::TestCase 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /test/models/review_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class ReviewTest < ActiveSupport::TestCase 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /test/models/user_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class UserTest < ActiveSupport::TestCase 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /test/test_helper.rb: -------------------------------------------------------------------------------- 1 | ENV["RAILS_ENV"] ||= "test" 2 | require File.expand_path('../../config/environment', __FILE__) 3 | require 'rails/test_help' 4 | 5 | class ActiveSupport::TestCase 6 | ActiveRecord::Migration.check_pending! 7 | 8 | # Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order. 9 | # 10 | # Note: You'll currently still have to declare fixtures explicitly in integration tests 11 | # -- they do not yet inherit this setting 12 | fixtures :all 13 | 14 | # Add more helper methods to be used by all tests here... 15 | end 16 | -------------------------------------------------------------------------------- /vendor/assets/javascripts/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jpub/RubyonRails4/c4bd37b9b9922f574dc64e57fc3ece48b0dc6f56/vendor/assets/javascripts/.keep -------------------------------------------------------------------------------- /vendor/assets/stylesheets/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jpub/RubyonRails4/c4bd37b9b9922f574dc64e57fc3ece48b0dc6f56/vendor/assets/stylesheets/.keep --------------------------------------------------------------------------------