Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Payment < ApplicationController
- before_filter login_required
- def new
- redirect_to some_other_path if @order.is_free?
- @payment = Payment.new
- end
- end
- `render_with_no_layout': Can only render or redirect once per action
- class PostsController < ApplicationController
- before_filter :perform_a_redirect, :except => [:wtf]
- def index
- redirect_to 'http://google.com'
- end
- def wtf
- render :text => 'wtf'
- end
- private
- def perform_a_redirect
- redirect_to :action => 'wtf'
- end
- end
Add Comment
Please, Sign In to add comment