rubyonjets / jets

Ruby on Jets
http://rubyonjets.com
MIT License
2.6k stars 181 forks source link

Controller redirect_back method #352

Closed scottwhudson closed 5 years ago

scottwhudson commented 5 years ago

Checklist

My Environment

Software Version
Operating System MacOS 10.14.6
Jets 2.1.1
Ruby 2.5.3

Expected Behaviour

I expect to be able to use the redirect_back method defined in ActionController within a jets controller.

Current Behavior

Calling redirect_back fails with the following NameError:

undefined local variable or method `redirect_back`for MY_CONTROLLER

Step-by-step reproduction instructions

Try calling redirect_back in any controller action.

Code Sample

class PagesController < ApplicationController
  def create
    @page = Page.new(pages_params)

    if @page.save
      redirect_to pages_url
    else
      redirect_back
    end
  end
end
tongueroo commented 5 years ago

Done in #359