Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8409483
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T23:55:24+00:00 2026-06-09T23:55:24+00:00

I want my page to refresh once a record has been created, at the

  • 0

I want my page to refresh once a record has been created, at the moment it directs it to the page before. here is the code from my controller:

def create
@license = License.new(params[:license])

respond_to do |format|
  if @license.save
    format.html { redirect_to :controller => 'customers', :action => 'index' }
    format.json { render json: @customer, status: :created, location: @customer }
  else
    format.html { render action: "new" }
    format.json { render json: @customer.errors, status: :unprocessable_entity }
  end

end

where it says redirect_to i need that to refresh, or link to the current page, with the current id, which would be :controller => 'customers', :action => 'show' but with the id of the current page’s record.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T23:55:26+00:00Added an answer on June 9, 2026 at 11:55 pm

    Try

    redirect_to customer_path(@license.id)
    

    instead.

    Depending on what your routes.rb file says, it should work.

    But if it doesn’t, try:

    redirect_to show_customer_path(@license.id)
    

    However, here I have to assume that somehow, your customers_controller.rb is somehow showing records from the License model. If License and Customer are separate models, you will have to find the customer_id in some other way.

    Perhaps, it is:

    redirect_to customer_path(@license.customer_id)
    

    If License is not connected to Customer in any way, you will need to pass it in as part of the post request.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want a php page to 'display' a pdf. Here is the code: <?php
Once the user is on my page, I do not want him to refresh
I want to submit a form without page refresh using jQuery. I found some
See code below: I want Page 1 to alert #testing... This works in C
I have created custom posts and I want one page in my site to
I have problems with deleting a record from the screen using MSQLI. Here you
I have this code: $('#page-refresh').click( function() { $.ajax({ url: /page1.php, cache: false, dataType: html,
Hey, I have 10 ul.rating elements on my page. I want to refresh those
All I want is to Refresh the page and pass a parameter back to
What I want to do is trigger a function from an extension/GM Script once

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.