Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

After create unable to redirect user to index path #17

Open
ITDevMohsin opened this issue Aug 31, 2016 · 0 comments
Open

After create unable to redirect user to index path #17

ITDevMohsin opened this issue Aug 31, 2016 · 0 comments

Comments

@ITDevMohsin
Copy link

ITDevMohsin commented Aug 31, 2016

Hi,

I am using your gem in my project, the problem is that upon entering data into the database, it does not look for respond_for block and redirect my page to show method.

The controller code I am working with is:

make_resourceful do
    actions :all

    response_for :create do |format|
      format.html {
        set_default_flash :notice, I18n.t('make_resourceful.create.success', :default => "Create successful!")
        redirect_to admin_apps_path
      }
    end
  end

  def index
    render template: 'admin/shared/index'
  end

  def show
  end

  def new
    @current_object = current_model.new()
    render template: 'admin/shared/new'
  end

  def create
    @current_object = Wine.new(apps_params)
    save_succeeded! if @current_object.save
  end

It does not enter into the:

format.html {
        set_default_flash :notice, I18n.t('make_resourceful.create.success', :default => "Create successful!")
        redirect_to admin_apps_path
      }

Could you please see.

The reference to question is: http://stackoverflow.com/questions/39238691/unable-to-redirect-to-index-path-after-create

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant