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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T09:38:43+00:00 2026-05-19T09:38:43+00:00

We have a structure where we want to view and edit records, filtered by

  • 0

We have a structure where we want to view and edit records, filtered by day. But we want the day to be part of the url

 /time_records/day

This view shows time_records for a particular day. But when we add a time_record, it needs to redirect back to the same page.

However, it invokes time_records without the “day” part in order to call create. In order to redirect back to the same page, I think I have to pass a model object to redirect_to, but that model would have to be the day itself.

Is the only solution to add a Day object to my model? This seems a bit of a waste as a DateTime is sufficient already logically, this is just about routing.

  • 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-19T09:38:43+00:00Added an answer on May 19, 2026 at 9:38 am

    With:

    match '/time_records(/:day)' => 'time_records#show', as: 'time_records'
    

    in routes.rb you can use the url helper method:

    time_records_path(day: Date.today)
    

    to generate "/time_records/2011-01-21". This works in part because in Rails, Date objects respond to the to_param method.

    This all assumes you’re using ruby 1.9.x and rails 3.0.x

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

Sidebar

Related Questions

I have this HTML structure and want to convert it to an accordion. <div
I have this file structure: folderIWantStuffIn/ - old_stuff Now I want to add some
I'd like to structure my website like this: domain.com/person/edit/1 domain.com/person/edit/2 domain.com/person/edit/3 etc. I have
Edit: this isn't to be a dynamic output, the output view structure is fixed.
I have TabBar View combined with Navigation View. Structure like this: delegate -> TabBar
I have a table Sample and another SampleLog With these structure I want to
i have table structure with 3 colums (column1, column2, column3) and i want to
I have a directory structure of directories and files that I want to render
I have a data structure of key value pairs and I want to implement
Assuming I have a tree structure UL --LI ---INPUT (checkbox) And I want to

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.