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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T00:43:05+00:00 2026-05-17T00:43:05+00:00

I have a Scouts model that requires two actions in addition to the standard

  • 0

I have a Scouts model that requires two actions in addition to the standard REST actions, check_in and check_out. So I have my route as:

resources :scouts do
  member do
    get 'check_in'
    get 'check_out'
   end
end

But I need to display the show.html to the user, with a link to check_in the Scout or check_out the scout. In order to utilize the same show.html view and keep only one show action in ScoutsController, I pass ?mode=check_in or ?mode=check_out appended to the url to designate this is not a regular show action and thus display “Check In” and “Check Out” links.

I thought about creating a check_in and check_out resource, but that doesn’t seem to fit the model of REST as checking in/out is an action and not a resource.

Is there a better way to handle this RESTfully?

Update: The mode comes from different users with differing agendas (i.e. workflows). One user may need to show and edit Scout data, while another will only be performing check_in activities.

But, the user that is performing check_in activities may need to edit. For example, the user performing check_in activities may spot an error in Scout data, fix it by editing, and return to their check_in activity. Passing the mode allows me to determine the users agenda. Also, adding the mode allows me to use only one show/edit/etc view and just display the appropriate links based on it.

I could put mode in the session hash. Either way, same result.

The benefit is a very simple user interface (for very simple users).

Seems to me that the Scout is the resource and check_in and check_out are the actions. But using the mode seems awkward. But maybe it really is the best way. That’s my question.

  • 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-17T00:43:06+00:00Added an answer on May 17, 2026 at 12:43 am

    It would appear to me that check_in and check_out relate to a registration, so I would think that you need another resource for registrations. check_in would map to create and check_out would map to destroy.

      resources :registrations
    
      match 'check_in', :to => "registrations#create", :as => "check_in"
      match 'check_out', :to => 'registrations#destroy', :as => "check_out"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Have a web service that implements REST (sort of) , Client request is made
here's what i have got two box one win 2003 server IIS6 another one
I'm building a site for the local cub scouts using Pinax. Does anyone have
From the given string that is $codes I just want to have all language
Have a network location that shows paths in the 8.3 short format. I need
Have data that has this kind of structure. Will be in ascending order by
Have data that has this kind of structure: $input = [ { animal: 'cat',
Have a query that should hopefully be nice and simple to answer. I have
I have an unusual problem that I managed to find the root of. I
I have a modal plugin on my page that shouts on $(document).ready but 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.