Ruby on Rails Thursday, October 15, 2015

hi to everybody ! :-) before ask something I prefer to say sorry for may bad english and sorry because I'm a junior developer of rails, in last 3 days I've tried to visualize some statistics in rails but I found a lot of problem somebody can help me ? I leave my DB struct if someone have some good idea

THIS IS WHAT I TRY TO DO: I've tried to visualize some data in a table for know how many event I've all day, and visualize: TOTAL PRICE, TOTAL_EVENT, TOTAL_PAX every day, if you see the DB table you can see I use a date range for every Event, and there I become to get MAD ! in the DB every event ha the struct

event price pax room_numer start_date end_date
1 2 2 1 10-10-2015 12-10-2015
2 3 12 2 8-10-2015 18-10-2015
3 2 20 3 12-10-2015 17-10-2015

AND this is what I want visualize

data total_event total_price total_pax
08/10 1 2 12
09/10 1 2 12
10/10 2 5 14
11/10 2 5 14
12/10 3 4 34
13/10 2 4 22
14/10 2 4 22
15/10 2 4 22
16/10 2 4 22
17/10 2 4 22
18/10 1 2 12
19/10 0 0 0

for made that I need to use a model because I've 3 view... week / month / year and I think is better use one Method ? right ?

somebody can help me ?

--
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/a96a0753-5931-48a2-8079-40fbbef8ef31%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment