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 4610312
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T01:06:48+00:00 2026-05-22T01:06:48+00:00

I gotta be missing something. I have a controller action for short urls: def

  • 0

I gotta be missing something. I have a controller action for short urls:

def shorturl
   redirect_to :action => show, :id => Base58.decode(params[:id]) and return
end

My intention is have this either redirect or load the regular show method of the same controller. At this point, I don’t care which way, just want to get it working first.

The problem is it throws a missing template error like its not exiting the shorturl method.

Missing template controller/shorturl with {:locale=>[:en, :en], :formats=>[:html], :handlers=>[:rhtml, :rxml, :builder, :erb, :rjs]} 

The console shows the query from show is executing so it seems its doing the redirect but still staying inside the method and expecting a view for shorturl instead of the redirected method.

  • 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-05-22T01:06:49+00:00Added an answer on May 22, 2026 at 1:06 am

    open your terminal, and go to project directory and type

       rake routes
    

    Will let you know about the various paths generated from your routes file.

    then redirect using

    redirect_to xyz_path(:id=> Base58.decode(params[:id]))
    return
    

    Edit:–

    redirect and render are too different things.

    redirect_to(:action=>’my_action’)
    

    will send a 302 redirect request to your browser, the consequence being that any existing variables are lost [2], and the action called ‘my_action’ will be executed.

    render(:action=>’my_action’)
    

    will NOT execute the code in the action called ‘my_action’ [1]. It will render the view only. Existing variables will not be lost.

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

Sidebar

Related Questions

I have this homework that I gotta finish, but then something about it is
I've gotta be missing something simple here. Take the following code: public IEnumerable<int> getInt(){
Gotta be something I'm doing wrong when converting the ttf with OpensIFRr, but I'm
I know this sounded stupid. But I gotta be doing something wrong here. Say,
Hi all I have a horrid database I gotta work with and linq to
There gotta be an easy way to do this, I can't believe there's none.
It's gotta be free. It's hobby, after all, not a business!. Creating for-profit software
here's the trick. gotta convert 'bout 300 files from xls to csv, wrote some
This is my first effort on solving the exercise. I gotta say, I'm kind
I gotta admit that's a first-timer bug for me. I've never seen that... I

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.