README.md in multiview-0.1.1 vs README.md in multiview-0.1.2

- old
+ new

@@ -1,10 +1,12 @@ # Multiview Support multiple versions for Rails views +[![Build Status](https://travis-ci.org/xiejiangzhi/multiview.svg?branch=master)](https://travis-ci.org/xiejiangzhi/multiview) + ## Installation Add this line to your application's Gemfile: ```ruby @@ -16,11 +18,11 @@ $ bundle ## Usage -### We project +### Example Project `app/controllers/topics_controller.rb` ``` class TopicsController < ApplicationController @@ -59,25 +61,26 @@ ``` ### Redispatch request by filter of controller -When get `/topics`, should redispatch to V2::TopicsController, don't call `TopicsController#index`, if we delete `V2::TopicsController` or change that config `{'topics' => 'v1'}`, it will call `TopicsController` +When get `/topics`, should redispatch to `V2::TopicsController#index`, rether than `TopicsController#index` +If delete `V2::TopicsController` or change that config `{'topics' => nil}`, it will call `TopicsController#index` ``` class ApplicationController < ActionController::Base before_aciton :set_view_version_filter - +. def set_view_version_filter $multiview.redispatch(self) # or # $multiview.redispatch(self, params[:controller], params[:action]) # if exist V3::XxxController, should to call V3::XxxController # if not, should to call XxxController and prepend v3 views path - # when you just want to change something for views, you should not to redefined a controller for the version + # when you only want to change something for views, you should not to create V3::XxxController for the version, just to make a view folder `app/views/v3/xxx` # $multiview.redispatch(self, params[:controller], params[:action], 'v3') end end ``` @@ -124,14 +127,14 @@ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org). ## Contributing -Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/multiview. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct. +Bug reports and pull requests are welcome on GitHub at https://github.com/xiejiangzhi/multiview. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct. ## License The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT). ## Code of Conduct -Everyone interacting in the Multiview project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/multiview/blob/master/CODE_OF_CONDUCT.md). +Everyone interacting in the Multiview project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/xiejiangzhi/multiview/blob/master/CODE_OF_CONDUCT.md).