Categories: None [Edit]

rails_source_path

https://rubygems.org/gems/rails_source_path
https://github.com/xiuzhong/rails_source_path
Remember the route prior to the current controller and redirect/use later In rails project, one common case is one form used to create or update an object can be routed from more than one page, when the object is created or updated, it should be redirected back to wherever it came from. Rails redirect_back doesn't work in this case because: 1. redirect_back in create/update action will go back to new/edit form. 2. usually the form is re-rendered if any error exists, which basically breaks the redirect_back. rails-source-path can hanlde this by explicily specifying the entry actions and remember the previous route in session store, hence can be used in the whole controller. Also a helper method is providered so it can be used in view like 'back' or 'cancel' button.

Total

Ranking: 111,927 of 187,239
Downloads: 6,327

Daily

Ranking: 116,310 of 187,224
Downloads: 2

Depended by

RankDownloadsName

Depends on

RankDownloadsName
12,973,208,875bundler
71,196,180,149activesupport
101,151,901,046rake
27919,404,019rspec
43671,311,427rails
117351,039,053rspec-rails

Owners

#GravatarHandle
1iconxiuzhong