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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T01:42:57+00:00 2026-06-07T01:42:57+00:00

I am trying to create this controller: def calculate # Do some calculations here

  • 0

I am trying to create this controller:

  def calculate
    # Do some calculations here     


    respond_to do |format|
      format.json{head status}
    end
  end

and I have a HAML file in which I make my HTML and in there I want to link to something like this:

=link_to("stats" , controller_path_url)

where controller_path is a rake routes path that is shown. My question is how do I make this sort of uniquely named controller function to be mapped and show its path when I do rake routes? Is there something I have to do in routes.rb? What should I change there?

Thanks!

  • 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-07T01:42:58+00:00Added an answer on June 7, 2026 at 1:42 am

    You should do smth like following in your routes.rb file:

    match ‘calculate’ => ‘controller_name#calculate’

    then run:

    bundle exec rake routes

    and see your path.

    It should be calculcate_path for path and calculate_url for full path.

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

Sidebar

Related Questions

Im Trying to create this: |---------------------------------------------| | Panel 1a | Panel 2a | Panel
I am trying to create this table in a MySQL database CREATE TABLE IF
I am trying to create this QT gui using a thread but no luck.
I am trying to create this tooltip sample for my wordpress it works just
I am trying to create this simple application in c#: when the user double
I'm trying to create this effect: http://www.thecssninja.com/demo/css_tree/ the problem I'm having is that the
I am trying to create something like this as i have done it in
I'm trying to find out how they were able to create this site. http://www.cpeople.ru
Trying to create a background-image slideshow and am getting this error... This is the
I'm trying to create something that works like this but doesn't have any submenus.

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.