> On Feb 9, 2019, at 1:55 PM, Daniel Toma <tomada36@gmail.com> wrote:
>
> I'm 5 weeks into a training program that consists of Ruby, Ruby on Rails, Javascript, and React. I'm about the wrap up the 3-week module for Ruby on Rails, and chose to do a project that simulates a basic airline reservation system.
> The requirements are minimal: have at least 3 classes (one being a join class) and use the CRUD methods with a Postgresql db. The processes of creating a reservation, reading an existing reservation, updating a reservation, and deleting a reservation are straightforward, but I'd like to jazz it up a bit for the presentation.
>
> I have the code that eliminates a seat from the list of available seats once that seat is reserved, but I was wondering if there's a way to incorporate a standard graphic that shows which seats are available (usually a green color) and which are taken (usually gray with an 'X'). I'm thinking that the graphic would be an HTML form with embedded Ruby, and that each "seat" could be represented. The graphic would represent my Index.html.erb view, that would show the seat number and its status (occupied vs. available). I just can't think of how this would be done, and I was wondering if anyone had an idea.
>
That looks like a really fun project. In the early 90's (yes, I'm old) I was commissioned to write a MacOS app for ticket sellers for venues where they could click on a similar seat layout to toggle their status from available to unavailable and be able to save the state and load it up later. (This was all in C at the time.)
Today I write software for property management in RoR to reserve dates for reservations for several hundred properties.
Anyway, for the purpose of your demo... you could cheat without using any JS and without having to reload the page if you just want a visual effect?
Something like this:
<html>
<head>
<style>
a:visited {
background-color: yellow;
}
a:link {
background-color: pink;
}
</style>
</head>
<body>
<p><a href="#1">Seat</a></p>
<p><a href="#2">Seat</a></p>
</body>
</html>
Good luck!
Phil
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/92383EAA-0B61-45D3-A119-23A8C60D2BC7%40gmail.com.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment