Skip to content

Latest commit

 

History

History
81 lines (50 loc) · 2.44 KB

README.md

File metadata and controls

81 lines (50 loc) · 2.44 KB

Rails4 Template

4point's rails4 template, modified from ihower's and other resources.

NOTICE

This repo could not be used NOW, because too many gems did not support rails4 yet.

CURRENT USAGE

could not use rails g scaffold yet, please use:

$ rails g scaffold_controller post title:string content:text
$ rails g model post title:string content:text

add 'resources :posts' to config/routes.rb

WARNING

This template DISABLE turbolinks by default. If you want to add it back, please check the following lines on your code:

  1. app/assets/javascripts/application.js

     //= require turbolinks
    
  2. app/views/layouts/application.html.erb

    <%= stylesheet_link_tag    "application", media: "all", "data-turbolinks-track" => true %>
    <%= javascript_include_tag "application", "data-turbolinks-track" => true %>
    

Usage:

Template for frontend only:

$ rails new YourAppName -m https://raw.github.com/4point/rails4-template/master/frontend.rb

Template for backend only:

$ rails new YourAppName -m https://raw.github.com/4point/rails4-template/master/backend.rb

and the scaffold command::

$ rails g scaffold post title:string content:text
$ rake db:migrate

Backend Screenshots

(rails new MyBlog -m https://raw.github.com/4point/rails4-template/master/full.rb)

frontend: /

frontend

login page: /admins/sign_in

login

backend page: /backend

backend

scaffold list: /backend/posts

list

search results:

search result

scaffold view: /backend/posts/1

view

TODO:

  1. admin add cancan
  2. admin add CRUD log
  3. admin change email and password

Reference

  1. https://github.com/gabetax/twitter-bootstrap-kaminari-views
  2. https://github.com/ihower/rails4-app-template
  3. http://twitter.github.com/bootstrap/
  4. https://github.com/plataformatec/devise
  5. https://github.com/ernie/ransack
  6. http://net.tutsplus.com/tutorials/ruby/digging-into-rails-4/
  7. http://edgeguides.rubyonrails.org/4_0_release_notes.html