├── .coveralls.yml ├── .gitignore ├── .rspec ├── .ruby-gemset ├── .ruby-version ├── .travis.yml ├── CHANGELOG.md ├── Gemfile ├── Guardfile ├── MIT-LICENSE ├── README.md ├── Rakefile ├── gemfiles ├── rails_32.gemfile ├── rails_40.gemfile ├── rails_41.gemfile └── rails_42.gemfile ├── lib ├── generators │ └── themes_on_rails │ │ ├── templates │ │ ├── all.css │ │ ├── all.js │ │ ├── layout.html.erb │ │ ├── layout.html.haml │ │ └── layout.html.liquid │ │ └── theme_generator.rb ├── themes_on_rails.rb └── themes_on_rails │ ├── action_controller.rb │ ├── controller_additions.rb │ ├── engine.rb │ └── version.rb ├── spec ├── dummy │ ├── .rspec │ ├── README.rdoc │ ├── Rakefile │ ├── app │ │ ├── assets │ │ │ ├── images │ │ │ │ └── .keep │ │ │ ├── javascripts │ │ │ │ ├── application.js │ │ │ │ └── posts.js │ │ │ └── stylesheets │ │ │ │ ├── application.css │ │ │ │ ├── posts.css │ │ │ │ └── scaffold.css │ │ ├── controllers │ │ │ ├── application_controller.rb │ │ │ ├── concerns │ │ │ │ └── .keep │ │ │ └── posts_controller.rb │ │ ├── helpers │ │ │ ├── application_helper.rb │ │ │ └── posts_helper.rb │ │ ├── mailers │ │ │ └── .keep │ │ ├── models │ │ │ ├── .keep │ │ │ ├── concerns │ │ │ │ └── .keep │ │ │ └── post.rb │ │ ├── themes │ │ │ ├── theme_a │ │ │ │ ├── assets │ │ │ │ │ ├── images │ │ │ │ │ │ └── theme_a │ │ │ │ │ │ │ └── .gitkeep │ │ │ │ │ ├── javascripts │ │ │ │ │ │ └── theme_a │ │ │ │ │ │ │ └── all.js │ │ │ │ │ └── stylesheets │ │ │ │ │ │ └── theme_a │ │ │ │ │ │ └── all.css │ │ │ │ └── views │ │ │ │ │ ├── layouts │ │ │ │ │ └── theme_a.html.haml │ │ │ │ │ └── posts │ │ │ │ │ ├── _form.html.erb │ │ │ │ │ ├── edit.html.erb │ │ │ │ │ ├── index.html.erb │ │ │ │ │ ├── new.html.erb │ │ │ │ │ └── show.html.erb │ │ │ ├── theme_b │ │ │ │ ├── assets │ │ │ │ │ ├── images │ │ │ │ │ │ └── theme_b │ │ │ │ │ │ │ └── .gitkeep │ │ │ │ │ ├── javascripts │ │ │ │ │ │ └── theme_b │ │ │ │ │ │ │ └── all.js │ │ │ │ │ └── stylesheets │ │ │ │ │ │ └── theme_b │ │ │ │ │ │ └── all.css │ │ │ │ └── views │ │ │ │ │ ├── layouts │ │ │ │ │ ├── alternate_theme_b.html.haml │ │ │ │ │ └── theme_b.html.haml │ │ │ │ │ └── posts │ │ │ │ │ ├── _form.html.erb │ │ │ │ │ ├── edit.html.erb │ │ │ │ │ ├── index.html.erb │ │ │ │ │ ├── new.html.erb │ │ │ │ │ └── show.html.erb │ │ │ └── theme_c │ │ │ │ ├── assets │ │ │ │ ├── images │ │ │ │ │ └── theme_c │ │ │ │ │ │ ├── .gitkeep │ │ │ │ │ │ └── 1.jpg │ │ │ │ ├── javascripts │ │ │ │ │ └── theme_c │ │ │ │ │ │ └── all.js │ │ │ │ └── stylesheets │ │ │ │ │ └── theme_c │ │ │ │ │ └── all.css │ │ │ │ ├── locales │ │ │ │ ├── en.yml │ │ │ │ └── km.yml │ │ │ │ └── views │ │ │ │ ├── layouts │ │ │ │ └── theme_c.liquid │ │ │ │ └── posts │ │ │ │ ├── _partial.liquid │ │ │ │ └── index.liquid │ │ └── views │ │ │ ├── layouts │ │ │ └── application.html.erb │ │ │ └── posts │ │ │ ├── _form.html.erb │ │ │ ├── edit.html.erb │ │ │ ├── index.html.erb │ │ │ ├── new.html.erb │ │ │ └── show.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 │ │ │ ├── secret_token.rb │ │ │ ├── session_store.rb │ │ │ └── wrap_parameters.rb │ │ ├── locales │ │ │ └── en.yml │ │ └── routes.rb │ ├── db │ │ ├── migrate │ │ │ └── 20131120082307_create_posts.rb │ │ └── schema.rb │ ├── lib │ │ └── assets │ │ │ └── .keep │ ├── log │ │ └── .keep │ ├── public │ │ ├── 404.html │ │ ├── 422.html │ │ ├── 500.html │ │ └── favicon.ico │ └── spec │ │ ├── controllers │ │ └── posts_controller_spec.rb │ │ └── spec_helper.rb ├── generators │ └── themes_on_rails │ │ └── theme_generator_spec.rb ├── lib │ ├── action_controller_spec.rb │ ├── controller_additions_spec.rb │ └── engine_spec.rb └── spec_helper.rb └── themes_on_rails.gemspec /.coveralls.yml: -------------------------------------------------------------------------------- 1 | service_name: travis-ci 2 | repo_token: J6JIa4VxzPyO5cNl0LRtiBRjfDHXdavjU 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .bundle/ 2 | log/*.log 3 | pkg/ 4 | Gemfile.lock 5 | gemfiles/*.lock 6 | coverage/ 7 | spec/dummy/db/*.sqlite3 8 | spec/dummy/log/*.log 9 | spec/dummy/tmp/ 10 | spec/dummy/.sass-cache 11 | -------------------------------------------------------------------------------- /.rspec: -------------------------------------------------------------------------------- 1 | --color 2 | -------------------------------------------------------------------------------- /.ruby-gemset: -------------------------------------------------------------------------------- 1 | themes_on_rails -------------------------------------------------------------------------------- /.ruby-version: -------------------------------------------------------------------------------- 1 | 2.3.0 2 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: ruby 2 | before_install: gem install bundler -v='1.11.2' 3 | script: 4 | - bundle exec rake db:migrate --trace 5 | - bundle exec rake db:test:prepare 6 | - bundle exec rake spec 7 | rvm: 8 | - 2.0.0 9 | - 2.1.5 10 | - 2.2.1 11 | gemfile: 12 | - gemfiles/rails_32.gemfile 13 | - gemfiles/rails_40.gemfile 14 | - gemfiles/rails_41.gemfile 15 | - gemfiles/rails_42.gemfile 16 | env: 17 | - RAILS_ENV=test 18 | notifications: 19 | email: false 20 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Overview 2 | 3 | ## 0.4.0 4 | 5 | * Support Rails 5 by (victorperez)[https://github.com/victorperez] 6 | 7 | ## 0.3.1 8 | 9 | * Make it thread-safe by [lowjoel](https://github.com/lowjoel) 10 | 11 | ## 0.3.0 12 | 13 | * Support liquid templates. 14 | * Support locales in theme directory. 15 | * Support Rails 4.2.x. 16 | * Fix bug switching theme in development, #7. 17 | 18 | ## 0.2.2 19 | 20 | * Fix precompile initializer in Rails 4.1.x. 21 | 22 | ## 0.2.1 23 | 24 | * Take environment check away in precompile initializer. 25 | 26 | ## 0.2.0 27 | 28 | * Support Rails 4.1.x. 29 | * Add precompile initializer for themes located at `app/themes`. 30 | 31 | ## 0.1.0 32 | 33 | * First Release 34 | * Support Rails 3/4. 35 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | source 'https://rubygems.org' 2 | 3 | gem 'rails', '~> 4.2.5' 4 | gem 'liquid-rails', '~> 0.1.3' 5 | gem 'rake', '~> 10.4.2' 6 | gem 'thin', '~> 1.6.3' 7 | gem 'jquery-rails', '~> 4.0.3' 8 | gem 'sqlite3', '~> 1.3.10' 9 | gem 'quiet_assets' 10 | gem 'pry', '~> 0.10.1' 11 | gem 'haml-rails', '~> 0.9.0' 12 | gem 'rspec-rails', '~> 3.4.0' 13 | gem 'guard-rspec', '~> 4.6.4' 14 | gem 'coveralls', require: false 15 | 16 | gemspec 17 | -------------------------------------------------------------------------------- /Guardfile: -------------------------------------------------------------------------------- 1 | # A sample Guardfile 2 | # More info at https://github.com/guard/guard#readme 3 | 4 | # Note: The cmd option is now required due to the increasing number of ways 5 | # rspec may be run, below are examples of the most common uses. 6 | # * bundler: 'bundle exec rspec' 7 | # * bundler binstubs: 'bin/rspec' 8 | # * spring: 'bin/rsspec' (This will use spring if running and you have 9 | # installed the spring binstubs per the docs) 10 | # * zeus: 'zeus rspec' (requires the server to be started separetly) 11 | # * 'just' rspec: 'rspec' 12 | guard :rspec, cmd: 'bundle exec rspec' do 13 | watch(%r{^spec/.+_spec\.rb$}) 14 | watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" } 15 | watch('spec/spec_helper.rb') { "spec" } 16 | 17 | # Rails example 18 | watch(%r{^app/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" } 19 | watch(%r{^app/(.*)(\.erb|\.haml|\.slim)$}) { |m| "spec/#{m[1]}#{m[2]}_spec.rb" } 20 | watch(%r{^app/controllers/(.+)_(controller)\.rb$}) { |m| ["spec/routing/#{m[1]}_routing_spec.rb", "spec/#{m[2]}s/#{m[1]}_#{m[2]}_spec.rb", "spec/acceptance/#{m[1]}_spec.rb"] } 21 | watch(%r{^spec/support/(.+)\.rb$}) { "spec" } 22 | watch('config/routes.rb') { "spec/routing" } 23 | watch('app/controllers/application_controller.rb') { "spec/controllers" } 24 | watch('spec/rails_helper.rb') { "spec" } 25 | 26 | # Capybara features specs 27 | watch(%r{^app/views/(.+)/.*\.(erb|haml|slim)$}) { |m| "spec/features/#{m[1]}_spec.rb" } 28 | 29 | # Turnip features and steps 30 | watch(%r{^spec/acceptance/(.+)\.feature$}) 31 | watch(%r{^spec/acceptance/steps/(.+)_steps\.rb$}) { |m| Dir[File.join("**/#{m[1]}.feature")][0] || 'spec/acceptance' } 32 | end 33 | 34 | -------------------------------------------------------------------------------- /MIT-LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2013 Chamnap Chhorn 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining 4 | a copy of this software and associated documentation files (the 5 | "Software"), to deal in the Software without restriction, including 6 | without limitation the rights to use, copy, modify, merge, publish, 7 | distribute, sublicense, and/or sell copies of the Software, and to 8 | permit persons to whom the Software is furnished to do so, subject to 9 | the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be 12 | included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ThemesOnRails [](https://travis-ci.org/yoolk/themes_on_rails) [](https://gemnasium.com/yoolk/themes_on_rails) [](https://codeclimate.com/github/yoolk/themes_on_rails) [](https://coveralls.io/r/yoolk/themes_on_rails?branch=master) [](http://badge.fury.io/rb/themes_on_rails) 2 | 3 | ## Installation 4 | 5 | The simplest way to install is to use Bundler. 6 | 7 | Add this gem to your Gemfile: 8 | 9 | gem 'themes_on_rails' 10 | 11 | If you want to use `themes_on_rails` with `liquid` template, add one more gem to your Gemfile: 12 | 13 | gem 'liquid-rails' 14 | 15 | Then, use Bundler to install the gem and its dependencies: 16 | 17 | $ bundle install 18 | 19 | ## Usage 20 | 21 | A theme is composed of three things: 22 | 23 | 1. Assets: images, javascripts, stylesheets 24 | 2. Views: templates and layouts (erb, haml, or other template engines) 25 | 3. Locales: locales files if any 26 | 27 | ### Generator 28 | 29 | To generate theme inside your app: 30 | 31 | $ rails g themes_on_rails:theme theme_name 32 | 33 |
34 | app/ 35 | themes/ 36 | [theme_name]/ 37 | assets/ 38 | images/ 39 | [theme_name]/ 40 | stylesheets/ 41 | [theme_name]/ 42 | all.css 43 | javascripts/ 44 | [theme_name]/ 45 | all.js 46 | views/ 47 | layouts/ 48 | [theme_name].html.erb 49 | locales/ 50 |51 | 52 | After you invoke the above command, make sure you restart your rails process. 53 | 54 | It's best advisable to namespace your assets directory so that it won't conflict with assets in other themes. 55 | 56 | ```ruby 57 | image_tag 'theme_a/logo.png' # => app/themes/theme_a/assets/images/theme_a/logo.png 58 | javascript_include_tag 'theme_a/all' # => app/themes/theme_a/assets/javascripts/theme_a/all.js 59 | stylesheet_link_tag 'theme_a/all' # => app/themes/theme_a/assets/stylesheets/theme_a/all.css 60 | ``` 61 | 62 | There is an example app at https://github.com/chamnap/themes_on_rails_example. 63 | 64 | ### Controller 65 | 66 | You can set theme in your controllers by using the `theme` declaration. For example: 67 | 68 | ```ruby 69 | class HomeController < ApplicationController 70 | theme 'basic' 71 | 72 | def index 73 | ... 74 | end 75 | end 76 | ``` 77 | 78 | With this declaration, all of the views rendered by the home controller will use `app/themes/basic/views/home/index.html.erb` as its templates and use `app/themes/basic/views/layouts/basic.html.erb`. 79 | 80 | You can use a symbol to defer the choice of theme until a request is processed: 81 | 82 | ```ruby 83 | class HomeController < ApplicationController 84 | theme :theme_resolver 85 | 86 | def index 87 | ... 88 | end 89 | 90 | private 91 | 92 | def theme_resolver 93 | params[:theme].presence || 'professional' 94 | end 95 | end 96 | ``` 97 | 98 | Now, if there is a `params[:theme]`, it will use that theme. Otherwise, it will use **professional** theme. 99 | 100 | You can even use an inline method, such as a **Proc**, to determine the theme. For example, if you pass a **Proc** object, the block you give the **Proc** will be given the controller instance, so the theme can be determined based on the current request: 101 | 102 | ```ruby 103 | class HomeController < ApplicationController 104 | theme Proc.new { |controller| controller.params[:theme].presence || 'professional' } 105 | end 106 | ``` 107 | 108 | Theme specified at the controller level support the `:only` and `:except` options. These options take either a method name, or an array of method names, corresponding to method names within the controller: 109 | 110 | ```ruby 111 | class HomeController < ApplicationController 112 | theme 'basic', except: [:rss] 113 | end 114 | ``` 115 | 116 | With this declaration, the **basic** theme would be used for everything but the `rss` index methods. 117 | 118 | ## Authors 119 | 120 | * [Chamnap Chhorn](https://github.com/chamnap) 121 | -------------------------------------------------------------------------------- /Rakefile: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env rake 2 | begin 3 | require 'bundler/setup' 4 | rescue LoadError 5 | puts 'You must `gem install bundler` and `bundle install` to run rake tasks' 6 | end 7 | 8 | # bunlder tasks 9 | Bundler::GemHelper.install_tasks 10 | 11 | # dummy app tasks 12 | require 'rake' 13 | load File.expand_path('spec/dummy/Rakefile') 14 | 15 | ENV["RAILS_ENV"] = "test" 16 | 17 | # spec tasks 18 | require 'rspec/core' 19 | require 'rspec/core/rake_task' 20 | 21 | # Add two methods to Rake::Task 22 | class Rake::Task 23 | def overwrite(&block) 24 | @actions.clear 25 | prerequisites.clear 26 | enhance(&block) 27 | end 28 | 29 | def abandon 30 | prerequisites.clear 31 | @actions.clear 32 | end 33 | end 34 | 35 | # Remove orginial `rake spec` 36 | Rake::Task[:spec].abandon 37 | 38 | RSpec::Core::RakeTask.new(:spec => 'db:test:prepare') do |spec| 39 | spec.pattern = FileList['spec/**/*_spec.rb'] 40 | end 41 | 42 | task :default => "spec:all" 43 | 44 | namespace :spec do 45 | %w(rails_42 rails_41 rails_40 rails_32).each do |gemfile| 46 | desc "Run Tests against #{gemfile}" 47 | task gemfile do 48 | sh "BUNDLE_GEMFILE='gemfiles/#{gemfile}.gemfile' bundle --quiet" 49 | sh "BUNDLE_GEMFILE='gemfiles/#{gemfile}.gemfile' bundle exec rake spec" 50 | end 51 | end 52 | 53 | desc "Run Tests against rails versions" 54 | task :all do 55 | %w(rails_42 rails_41 rails_40 rails_32).each do |gemfile| 56 | sh "BUNDLE_GEMFILE='gemfiles/#{gemfile}.gemfile' bundle --quiet" 57 | sh "BUNDLE_GEMFILE='gemfiles/#{gemfile}.gemfile' bundle exec rake spec" 58 | end 59 | end 60 | end -------------------------------------------------------------------------------- /gemfiles/rails_32.gemfile: -------------------------------------------------------------------------------- 1 | source 'https://rubygems.org' 2 | 3 | gem 'rails', '~> 3.2.22' 4 | gem 'liquid-rails', '~> 0.1.0' 5 | gem 'rake', '~> 10.4.2' 6 | gem 'thin', '~> 1.6.3' 7 | gem 'jquery-rails', '~> 3.1.2' 8 | gem 'sqlite3', '~> 1.3.10' 9 | gem 'quiet_assets' 10 | gem 'pry', '~> 0.10.1' 11 | gem 'haml-rails', '~> 0.4' 12 | gem 'rspec-rails', '~> 3.2.0' 13 | gem 'guard-rspec', '~> 4.5.0' 14 | gem 'coveralls', require: false 15 | gem 'test-unit', '~> 3.0' 16 | 17 | gemspec :path => '../' 18 | -------------------------------------------------------------------------------- /gemfiles/rails_40.gemfile: -------------------------------------------------------------------------------- 1 | source 'https://rubygems.org' 2 | 3 | gem 'rails', '~> 4.0.13' 4 | gem 'liquid-rails', '~> 0.1.0' 5 | gem 'rake', '~> 10.4.2' 6 | gem 'thin', '~> 1.6.3' 7 | gem 'jquery-rails', '~> 3.1.2' 8 | gem 'sqlite3', '~> 1.3.10' 9 | gem 'quiet_assets' 10 | gem 'pry', '~> 0.10.1' 11 | gem 'haml-rails', '~> 0.8.2' 12 | gem 'rspec-rails', '~> 3.2.0' 13 | gem 'guard-rspec', '~> 4.5.0' 14 | gem 'coveralls', require: false 15 | 16 | gemspec :path => '../' 17 | -------------------------------------------------------------------------------- /gemfiles/rails_41.gemfile: -------------------------------------------------------------------------------- 1 | source 'https://rubygems.org' 2 | 3 | gem 'rails', '~> 4.1.14' 4 | gem 'liquid-rails', '~> 0.1.0' 5 | gem 'rake', '~> 10.4.2' 6 | gem 'thin', '~> 1.6.3' 7 | gem 'jquery-rails', '~> 3.1.2' 8 | gem 'sqlite3', '~> 1.3.10' 9 | gem 'quiet_assets' 10 | gem 'pry', '~> 0.10.1' 11 | gem 'haml-rails', '~> 0.8.2' 12 | gem 'rspec-rails', '~> 3.2.0' 13 | gem 'guard-rspec', '~> 4.5.0' 14 | gem 'coveralls', require: false 15 | 16 | gemspec :path => '../' 17 | -------------------------------------------------------------------------------- /gemfiles/rails_42.gemfile: -------------------------------------------------------------------------------- 1 | source 'https://rubygems.org' 2 | 3 | gem 'rails', '~> 4.2.5' 4 | gem 'liquid-rails', '~> 0.1.3' 5 | gem 'rake', '~> 10.4.2' 6 | gem 'thin', '~> 1.6.3' 7 | gem 'jquery-rails', '~> 4.0.3' 8 | gem 'sqlite3', '~> 1.3.10' 9 | gem 'quiet_assets' 10 | gem 'pry', '~> 0.10.1' 11 | gem 'haml-rails', '~> 0.9.0' 12 | gem 'rspec-rails', '~> 3.4.0' 13 | gem 'guard-rspec', '~> 4.6.4' 14 | gem 'coveralls', require: false 15 | 16 | gemspec :path => '../' 17 | -------------------------------------------------------------------------------- /lib/generators/themes_on_rails/templates/all.css: -------------------------------------------------------------------------------- 1 | /* 2 | * This is a manifest file that'll automatically include all the stylesheets available in this directory 3 | * and any sub-directories. You're free to add application-wide styles to this file and they'll appear at 4 | * the top of the compiled file, but it's generally better to create a new file per style scope. 5 | * 6 | 7 | *= require_self 8 | *= require_tree . 9 | */ -------------------------------------------------------------------------------- /lib/generators/themes_on_rails/templates/all.js: -------------------------------------------------------------------------------- 1 | // This is a manifest file that'll be compiled into including all the files listed below. 2 | // Add new JavaScript/Coffee code in separate files in this directory and they'll automatically 3 | // be included in the compiled file accessible from http://example.com/assets/application.js 4 | // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the 5 | // the compiled file. 6 | // 7 | //= require_tree . -------------------------------------------------------------------------------- /lib/generators/themes_on_rails/templates/layout.html.erb: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |
Title | 7 |Description | 8 |9 | | 10 | | 11 | |
---|---|---|---|---|
<%= post.title %> | 18 |<%= post.description %> | 19 |<%= link_to 'Show', post %> | 20 |<%= link_to 'Edit', edit_post_path(post) %> | 21 |<%= link_to 'Destroy', post, method: :delete, data: { confirm: 'Are you sure?' } %> | 22 |
<%= notice %>
2 |5 | Title: 6 | <%= @post.title %> 7 |
8 | 9 |10 | Description: 11 | <%= @post.description %> 12 |
13 | 14 | <%= link_to 'Edit', edit_post_path(@post) %> | 15 | <%= link_to 'Back', posts_path %> 16 | -------------------------------------------------------------------------------- /spec/dummy/app/themes/theme_b/assets/images/theme_b/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chamnap/themes_on_rails/c03669a0ef9fd8b0cd38309a2cfdc6dfcc8c80da/spec/dummy/app/themes/theme_b/assets/images/theme_b/.gitkeep -------------------------------------------------------------------------------- /spec/dummy/app/themes/theme_b/assets/javascripts/theme_b/all.js: -------------------------------------------------------------------------------- 1 | // This is a manifest file that'll be compiled into including all the files listed below. 2 | // Add new JavaScript/Coffee code in separate files in this directory and they'll automatically 3 | // be included in the compiled file accessible from http://example.com/assets/application.js 4 | // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the 5 | // the compiled file. 6 | // 7 | //= require_tree . -------------------------------------------------------------------------------- /spec/dummy/app/themes/theme_b/assets/stylesheets/theme_b/all.css: -------------------------------------------------------------------------------- 1 | /* 2 | * This is a manifest file that'll automatically include all the stylesheets available in this directory 3 | * and any sub-directories. You're free to add application-wide styles to this file and they'll appear at 4 | * the top of the compiled file, but it's generally better to create a new file per style scope. 5 | * 6 | 7 | *= require_self 8 | *= require_tree . 9 | */ -------------------------------------------------------------------------------- /spec/dummy/app/themes/theme_b/views/layouts/alternate_theme_b.html.haml: -------------------------------------------------------------------------------- 1 | !!! 2 | %html 3 | %head 4 | %title Alternate Theme B 5 | = stylesheet_link_tag "theme_b/all", media: "all", "data-turbolinks-track" => true 6 | = javascript_include_tag "theme_b/all", "data-turbolinks-track" => true 7 | = csrf_meta_tags 8 | %body 9 | = yield -------------------------------------------------------------------------------- /spec/dummy/app/themes/theme_b/views/layouts/theme_b.html.haml: -------------------------------------------------------------------------------- 1 | !!! 2 | %html 3 | %head 4 | %title Theme B 5 | = stylesheet_link_tag "theme_b/all", media: "all", "data-turbolinks-track" => true 6 | = javascript_include_tag "theme_b/all", "data-turbolinks-track" => true 7 | = csrf_meta_tags 8 | %body 9 | = yield -------------------------------------------------------------------------------- /spec/dummy/app/themes/theme_b/views/posts/_form.html.erb: -------------------------------------------------------------------------------- 1 | <%= form_for(@post) do |f| %> 2 | <% if @post.errors.any? %> 3 |Title | 7 |Description | 8 |9 | | 10 | | 11 | |
---|---|---|---|---|
<%= post.title %> | 18 |<%= post.description %> | 19 |<%= link_to 'Show', post %> | 20 |<%= link_to 'Edit', edit_post_path(post) %> | 21 |<%= link_to 'Destroy', post, method: :delete, data: { confirm: 'Are you sure?' } %> | 22 |
<%= notice %>
2 |5 | Title: 6 | <%= @post.title %> 7 |
8 | 9 |10 | Description: 11 | <%= @post.description %> 12 |
13 | 14 | <%= link_to 'Edit', edit_post_path(@post) %> | 15 | <%= link_to 'Back', posts_path %> 16 | -------------------------------------------------------------------------------- /spec/dummy/app/themes/theme_c/assets/images/theme_c/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chamnap/themes_on_rails/c03669a0ef9fd8b0cd38309a2cfdc6dfcc8c80da/spec/dummy/app/themes/theme_c/assets/images/theme_c/.gitkeep -------------------------------------------------------------------------------- /spec/dummy/app/themes/theme_c/assets/images/theme_c/1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chamnap/themes_on_rails/c03669a0ef9fd8b0cd38309a2cfdc6dfcc8c80da/spec/dummy/app/themes/theme_c/assets/images/theme_c/1.jpg -------------------------------------------------------------------------------- /spec/dummy/app/themes/theme_c/assets/javascripts/theme_c/all.js: -------------------------------------------------------------------------------- 1 | // This is a manifest file that'll be compiled into including all the files listed below. 2 | // Add new JavaScript/Coffee code in separate files in this directory and they'll automatically 3 | // be included in the compiled file accessible from http://example.com/assets/application.js 4 | // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the 5 | // the compiled file. 6 | // 7 | //= require_tree . -------------------------------------------------------------------------------- /spec/dummy/app/themes/theme_c/assets/stylesheets/theme_c/all.css: -------------------------------------------------------------------------------- 1 | /* 2 | * This is a manifest file that'll automatically include all the stylesheets available in this directory 3 | * and any sub-directories. You're free to add application-wide styles to this file and they'll appear at 4 | * the top of the compiled file, but it's generally better to create a new file per style scope. 5 | * 6 | 7 | *= require_self 8 | *= require_tree . 9 | */ -------------------------------------------------------------------------------- /spec/dummy/app/themes/theme_c/locales/en.yml: -------------------------------------------------------------------------------- 1 | en: 2 | theme_c: 3 | links: 4 | home: 'Home' -------------------------------------------------------------------------------- /spec/dummy/app/themes/theme_c/locales/km.yml: -------------------------------------------------------------------------------- 1 | km: 2 | theme_c: 3 | links: 4 | home: 'ទំព័រដើម' -------------------------------------------------------------------------------- /spec/dummy/app/themes/theme_c/views/layouts/theme_c.liquid: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |Title | 7 |Description | 8 |9 | | 10 | | 11 | |
---|---|---|---|---|
<%= post.title %> | 18 |<%= post.description %> | 19 |<%= link_to 'Show', post %> | 20 |<%= link_to 'Edit', edit_post_path(post) %> | 21 |<%= link_to 'Destroy', post, method: :delete, data: { confirm: 'Are you sure?' } %> | 22 |
<%= notice %>
2 | 3 |4 | Title: 5 | <%= @post.title %> 6 |
7 | 8 |9 | Description: 10 | <%= @post.description %> 11 |
12 | 13 | <%= link_to 'Edit', edit_post_path(@post) %> | 14 | <%= link_to 'Back', posts_path %> 15 | -------------------------------------------------------------------------------- /spec/dummy/bin/bundle: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) 3 | load Gem.bin_path('bundler', 'bundle') 4 | -------------------------------------------------------------------------------- /spec/dummy/bin/rails: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | APP_PATH = File.expand_path('../../config/application', __FILE__) 3 | require_relative '../config/boot' 4 | require 'rails/commands' 5 | -------------------------------------------------------------------------------- /spec/dummy/bin/rake: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | require_relative '../config/boot' 3 | require 'rake' 4 | Rake.application.run 5 | -------------------------------------------------------------------------------- /spec/dummy/config.ru: -------------------------------------------------------------------------------- 1 | # This file is used by Rack-based servers to start the application. 2 | 3 | require ::File.expand_path('../config/environment', __FILE__) 4 | run Rails.application 5 | -------------------------------------------------------------------------------- /spec/dummy/config/application.rb: -------------------------------------------------------------------------------- 1 | require File.expand_path('../boot', __FILE__) 2 | 3 | require 'rails/all' 4 | 5 | Bundler.require(*Rails.groups) 6 | require "themes_on_rails" 7 | 8 | module Dummy 9 | class Application < Rails::Application 10 | # Settings in config/environments/* take precedence over those specified here. 11 | # Application configuration should go into files in config/initializers 12 | # -- all .rb files in that directory are automatically loaded. 13 | 14 | # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone. 15 | # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC. 16 | # config.time_zone = 'Central Time (US & Canada)' 17 | 18 | # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded. 19 | # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s] 20 | # config.i18n.default_locale = :de 21 | end 22 | end -------------------------------------------------------------------------------- /spec/dummy/config/boot.rb: -------------------------------------------------------------------------------- 1 | # Set up gems listed in the Gemfile. 2 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../../../Gemfile', __FILE__) 3 | 4 | require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE']) 5 | $LOAD_PATH.unshift File.expand_path('../../../../lib', __FILE__) 6 | -------------------------------------------------------------------------------- /spec/dummy/config/database.yml: -------------------------------------------------------------------------------- 1 | # SQLite version 3.x 2 | # gem install sqlite3 3 | # 4 | # Ensure the SQLite 3 gem is defined in your Gemfile 5 | # gem 'sqlite3' 6 | development: 7 | adapter: sqlite3 8 | database: db/development.sqlite3 9 | pool: 5 10 | timeout: 5000 11 | 12 | # Warning: The database defined as "test" will be erased and 13 | # re-generated from your development database when you run "rake". 14 | # Do not set this db to the same as development or production. 15 | test: 16 | adapter: sqlite3 17 | database: db/test.sqlite3 18 | pool: 5 19 | timeout: 5000 20 | 21 | production: 22 | adapter: sqlite3 23 | database: db/production.sqlite3 24 | pool: 5 25 | timeout: 5000 26 | -------------------------------------------------------------------------------- /spec/dummy/config/environment.rb: -------------------------------------------------------------------------------- 1 | # Load the Rails application. 2 | require File.expand_path('../application', __FILE__) 3 | 4 | # Initialize the Rails application. 5 | Dummy::Application.initialize! 6 | -------------------------------------------------------------------------------- /spec/dummy/config/environments/development.rb: -------------------------------------------------------------------------------- 1 | Dummy::Application.configure do 2 | # Settings specified here will take precedence over those in config/application.rb. 3 | 4 | # In the development environment your application's code is reloaded on 5 | # every request. This slows down response time but is perfect for development 6 | # since you don't have to restart the web server when you make code changes. 7 | config.cache_classes = false 8 | 9 | # Do not eager load code on boot. 10 | config.eager_load = false 11 | 12 | # Show full error reports and disable caching. 13 | config.consider_all_requests_local = true 14 | config.action_controller.perform_caching = false 15 | 16 | # Don't care if the mailer can't send. 17 | config.action_mailer.raise_delivery_errors = false 18 | 19 | # Print deprecation notices to the Rails logger. 20 | config.active_support.deprecation = :log 21 | 22 | # Raise an error on page load if there are pending migrations 23 | config.active_record.migration_error = :page_load 24 | 25 | # Debug mode disables concatenation and preprocessing of assets. 26 | # This option may cause significant delays in view rendering with a large 27 | # number of complex assets. 28 | config.assets.debug = true 29 | end 30 | -------------------------------------------------------------------------------- /spec/dummy/config/environments/production.rb: -------------------------------------------------------------------------------- 1 | Dummy::Application.configure do 2 | # Settings specified here will take precedence over those in config/application.rb. 3 | 4 | # Code is not reloaded between requests. 5 | config.cache_classes = true 6 | 7 | # Eager load code on boot. This eager loads most of Rails and 8 | # your application in memory, allowing both thread web servers 9 | # and those relying on copy on write to perform better. 10 | # Rake tasks automatically ignore this option for performance. 11 | config.eager_load = true 12 | 13 | # Full error reports are disabled and caching is turned on. 14 | config.consider_all_requests_local = false 15 | config.action_controller.perform_caching = true 16 | 17 | # Enable Rack::Cache to put a simple HTTP cache in front of your application 18 | # Add `rack-cache` to your Gemfile before enabling this. 19 | # For large-scale production use, consider using a caching reverse proxy like nginx, varnish or squid. 20 | # config.action_dispatch.rack_cache = true 21 | 22 | # Disable Rails's static asset server (Apache or nginx will already do this). 23 | config.serve_static_files = false 24 | 25 | # Compress JavaScripts and CSS. 26 | config.assets.js_compressor = :uglifier 27 | # config.assets.css_compressor = :sass 28 | 29 | # Do not fallback to assets pipeline if a precompiled asset is missed. 30 | config.assets.compile = false 31 | 32 | # Generate digests for assets URLs. 33 | config.assets.digest = true 34 | 35 | # Version of your assets, change this if you want to expire all your assets. 36 | config.assets.version = '1.0' 37 | 38 | # Specifies the header that your server uses for sending files. 39 | # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache 40 | # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx 41 | 42 | # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. 43 | # config.force_ssl = true 44 | 45 | # Set to :debug to see everything in the log. 46 | config.log_level = :info 47 | 48 | # Prepend all log lines with the following tags. 49 | # config.log_tags = [ :subdomain, :uuid ] 50 | 51 | # Use a different logger for distributed setups. 52 | # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new) 53 | 54 | # Use a different cache store in production. 55 | # config.cache_store = :mem_cache_store 56 | 57 | # Enable serving of images, stylesheets, and JavaScripts from an asset server. 58 | # config.action_controller.asset_host = "http://assets.example.com" 59 | 60 | # Precompile additional assets. 61 | # application.js, application.css, and all non-JS/CSS in app/assets folder are already added. 62 | # config.assets.precompile += %w( search.js ) 63 | 64 | # Ignore bad email addresses and do not raise email delivery errors. 65 | # Set this to true and configure the email server for immediate delivery to raise delivery errors. 66 | # config.action_mailer.raise_delivery_errors = false 67 | 68 | # Enable locale fallbacks for I18n (makes lookups for any locale fall back to 69 | # the I18n.default_locale when a translation can not be found). 70 | config.i18n.fallbacks = true 71 | 72 | # Send deprecation notices to registered listeners. 73 | config.active_support.deprecation = :notify 74 | 75 | # Disable automatic flushing of the log to improve performance. 76 | # config.autoflush_log = false 77 | 78 | # Use default logging formatter so that PID and timestamp are not suppressed. 79 | config.log_formatter = ::Logger::Formatter.new 80 | end 81 | -------------------------------------------------------------------------------- /spec/dummy/config/environments/test.rb: -------------------------------------------------------------------------------- 1 | Dummy::Application.configure do 2 | # Settings specified here will take precedence over those in config/application.rb. 3 | 4 | # The test environment is used exclusively to run your application's 5 | # test suite. You never need to work with it otherwise. Remember that 6 | # your test database is "scratch space" for the test suite and is wiped 7 | # and recreated between test runs. Don't rely on the data there! 8 | config.cache_classes = true 9 | 10 | # Do not eager load code on boot. This avoids loading your whole application 11 | # just for the purpose of running a single test. If you are using a tool that 12 | # preloads Rails for running tests, you may have to set it to true. 13 | config.eager_load = false 14 | 15 | # Configure static asset server for tests with Cache-Control for performance. 16 | config.serve_static_files = true 17 | config.static_cache_control = "public, max-age=3600" 18 | 19 | # Show full error reports and disable caching. 20 | config.consider_all_requests_local = true 21 | config.action_controller.perform_caching = false 22 | 23 | # Raise exceptions instead of rendering exception templates. 24 | config.action_dispatch.show_exceptions = false 25 | 26 | # Disable request forgery protection in test environment. 27 | config.action_controller.allow_forgery_protection = false 28 | 29 | # Tell Action Mailer not to deliver emails to the real world. 30 | # The :test delivery method accumulates sent emails in the 31 | # ActionMailer::Base.deliveries array. 32 | config.action_mailer.delivery_method = :test 33 | 34 | # Print deprecation notices to the stderr. 35 | config.active_support.deprecation = :stderr 36 | end 37 | -------------------------------------------------------------------------------- /spec/dummy/config/initializers/backtrace_silencers.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces. 4 | # Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ } 5 | 6 | # You can also remove all the silencers if you're trying to debug a problem that might stem from framework code. 7 | # Rails.backtrace_cleaner.remove_silencers! 8 | -------------------------------------------------------------------------------- /spec/dummy/config/initializers/filter_parameter_logging.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Configure sensitive parameters which will be filtered from the log file. 4 | Rails.application.config.filter_parameters += [:password] 5 | -------------------------------------------------------------------------------- /spec/dummy/config/initializers/inflections.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Add new inflection rules using the following format. Inflections 4 | # are locale specific, and you may define rules for as many different 5 | # locales as you wish. All of these examples are active by default: 6 | # ActiveSupport::Inflector.inflections(:en) do |inflect| 7 | # inflect.plural /^(ox)$/i, '\1en' 8 | # inflect.singular /^(ox)en/i, '\1' 9 | # inflect.irregular 'person', 'people' 10 | # inflect.uncountable %w( fish sheep ) 11 | # end 12 | 13 | # These inflection rules are supported but not enabled by default: 14 | # ActiveSupport::Inflector.inflections(:en) do |inflect| 15 | # inflect.acronym 'RESTful' 16 | # end 17 | -------------------------------------------------------------------------------- /spec/dummy/config/initializers/mime_types.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Add new mime types for use in respond_to blocks: 4 | # Mime::Type.register "text/richtext", :rtf 5 | # Mime::Type.register_alias "text/html", :iphone 6 | -------------------------------------------------------------------------------- /spec/dummy/config/initializers/secret_token.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Your secret key is used for verifying the integrity of signed cookies. 4 | # If you change this key, all old signed cookies will become invalid! 5 | 6 | # Make sure the secret is at least 30 characters and all random, 7 | # no regular words or you'll be exposed to dictionary attacks. 8 | # You can use `rake secret` to generate a secure secret key. 9 | 10 | # Make sure your secret_key_base is kept private 11 | # if you're sharing your code publicly. 12 | Dummy::Application.config.secret_key_base = 'ee6d27b27f2b943a0babc187f675411fbfbf8444d530071395cb11b18e748b40a56956fcdf5262709dda326397c1fef182d89c00d8f959ac295887d5a0d1c88c' 13 | -------------------------------------------------------------------------------- /spec/dummy/config/initializers/session_store.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | Dummy::Application.config.session_store :cookie_store, key: '_dummy_session' 4 | -------------------------------------------------------------------------------- /spec/dummy/config/initializers/wrap_parameters.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # This file contains settings for ActionController::ParamsWrapper which 4 | # is enabled by default. 5 | 6 | # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array. 7 | ActiveSupport.on_load(:action_controller) do 8 | wrap_parameters format: [:json] if respond_to?(:wrap_parameters) 9 | end 10 | 11 | # To enable root element in JSON for ActiveRecord objects. 12 | # ActiveSupport.on_load(:active_record) do 13 | # self.include_root_in_json = true 14 | # end 15 | -------------------------------------------------------------------------------- /spec/dummy/config/locales/en.yml: -------------------------------------------------------------------------------- 1 | # Files in the config/locales directory are used for internationalization 2 | # and are automatically loaded by Rails. If you want to use locales other 3 | # than English, add the necessary files in this directory. 4 | # 5 | # To use the locales, use `I18n.t`: 6 | # 7 | # I18n.t 'hello' 8 | # 9 | # In views, this is aliased to just `t`: 10 | # 11 | # <%= t('hello') %> 12 | # 13 | # To use a different locale, set it with `I18n.locale`: 14 | # 15 | # I18n.locale = :es 16 | # 17 | # This would use the information in config/locales/es.yml. 18 | # 19 | # To learn more, please read the Rails Internationalization guide 20 | # available at http://guides.rubyonrails.org/i18n.html. 21 | 22 | en: 23 | hello: "Hello world" 24 | -------------------------------------------------------------------------------- /spec/dummy/config/routes.rb: -------------------------------------------------------------------------------- 1 | Dummy::Application.routes.draw do 2 | resources :posts do 3 | get :get_theme, on: :collection 4 | end 5 | 6 | # The priority is based upon order of creation: first created -> highest priority. 7 | # See how all your routes lay out with "rake routes". 8 | 9 | # You can have the root of your site routed with "root" 10 | # root 'welcome#index' 11 | 12 | # Example of regular route: 13 | # get 'products/:id' => 'catalog#view' 14 | 15 | # Example of named route that can be invoked with purchase_url(id: product.id) 16 | # get 'products/:id/purchase' => 'catalog#purchase', as: :purchase 17 | 18 | # Example resource route (maps HTTP verbs to controller actions automatically): 19 | # resources :products 20 | 21 | # Example resource route with options: 22 | # resources :products do 23 | # member do 24 | # get 'short' 25 | # post 'toggle' 26 | # end 27 | # 28 | # collection do 29 | # get 'sold' 30 | # end 31 | # end 32 | 33 | # Example resource route with sub-resources: 34 | # resources :products do 35 | # resources :comments, :sales 36 | # resource :seller 37 | # end 38 | 39 | # Example resource route with more complex sub-resources: 40 | # resources :products do 41 | # resources :comments 42 | # resources :sales do 43 | # get 'recent', on: :collection 44 | # end 45 | # end 46 | 47 | # Example resource route with concerns: 48 | # concern :toggleable do 49 | # post 'toggle' 50 | # end 51 | # resources :posts, concerns: :toggleable 52 | # resources :photos, concerns: :toggleable 53 | 54 | # Example resource route within a namespace: 55 | # namespace :admin do 56 | # # Directs /admin/products/* to Admin::ProductsController 57 | # # (app/controllers/admin/products_controller.rb) 58 | # resources :products 59 | # end 60 | end 61 | -------------------------------------------------------------------------------- /spec/dummy/db/migrate/20131120082307_create_posts.rb: -------------------------------------------------------------------------------- 1 | class CreatePosts < ActiveRecord::Migration 2 | def change 3 | create_table :posts do |t| 4 | t.string :title 5 | t.text :description 6 | 7 | t.timestamps 8 | end 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /spec/dummy/db/schema.rb: -------------------------------------------------------------------------------- 1 | # encoding: UTF-8 2 | # This file is auto-generated from the current state of the database. Instead 3 | # of editing this file, please use the migrations feature of Active Record to 4 | # incrementally modify your database, and then regenerate this schema definition. 5 | # 6 | # Note that this schema.rb definition is the authoritative source for your 7 | # database schema. If you need to create the application database on another 8 | # system, you should be using db:schema:load, not running all the migrations 9 | # from scratch. The latter is a flawed and unsustainable approach (the more migrations 10 | # you'll amass, the slower it'll run and the greater likelihood for issues). 11 | # 12 | # It's strongly recommended to check this file into your version control system. 13 | 14 | ActiveRecord::Schema.define(:version => 20131120082307) do 15 | 16 | create_table "posts", :force => true do |t| 17 | t.string "title" 18 | t.text "description" 19 | t.datetime "created_at" 20 | t.datetime "updated_at" 21 | end 22 | 23 | end 24 | -------------------------------------------------------------------------------- /spec/dummy/lib/assets/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chamnap/themes_on_rails/c03669a0ef9fd8b0cd38309a2cfdc6dfcc8c80da/spec/dummy/lib/assets/.keep -------------------------------------------------------------------------------- /spec/dummy/log/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chamnap/themes_on_rails/c03669a0ef9fd8b0cd38309a2cfdc6dfcc8c80da/spec/dummy/log/.keep -------------------------------------------------------------------------------- /spec/dummy/public/404.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |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 | -------------------------------------------------------------------------------- /spec/dummy/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 | -------------------------------------------------------------------------------- /spec/dummy/public/500.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |If you are the application owner check the logs for more information.
56 | 57 | 58 | -------------------------------------------------------------------------------- /spec/dummy/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chamnap/themes_on_rails/c03669a0ef9fd8b0cd38309a2cfdc6dfcc8c80da/spec/dummy/public/favicon.ico -------------------------------------------------------------------------------- /spec/dummy/spec/controllers/posts_controller_spec.rb: -------------------------------------------------------------------------------- 1 | require "spec_helper" 2 | 3 | describe PostsController do 4 | render_views 5 | 6 | context "theme :theme_b" do 7 | it "renders with provided theme :theme_b" do 8 | get :index, theme: "theme_b" 9 | 10 | expect(response.body).to match(/