Google Mail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
comparing data
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  8 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Follow-up To:
Add Cc | Add Follow-up to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers that you hear
 
Aljaz Fajmut  
View profile   Translate to Translated (View Original)
 More options 8 Nov, 13:31
From: Aljaz Fajmut <rails-mailing-l...@andreas-s.net>
Date: Sun, 8 Nov 2009 14:31:10 +0100
Local: Sun 8 Nov 2009 13:31
Subject: comparing data
Hello,

I'm trying to implement Rails functionality which would allow to compare
Model records (in my case different plans).

I'm unsure what would be the proper approach towards this with Rails, is
there any tutorial for doing something like available on internet/book?

Which would be better: to pass the comparing model ids to the compare
controller by post or by url?

Any tips are highly appreciated.
--
Posted via http://www.ruby-forum.com/.


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Colin Law  
View profile   Translate to Translated (View Original)
 More options 8 Nov, 13:41
From: Colin Law <clan...@googlemail.com>
Date: Sun, 8 Nov 2009 13:41:32 +0000
Local: Sun 8 Nov 2009 13:41
Subject: Re: [Rails] comparing data
2009/11/8 Aljaz Fajmut <rails-mailing-l...@andreas-s.net>:

> Hello,

> I'm trying to implement Rails functionality which would allow to compare
> Model records (in my case different plans).

> I'm unsure what would be the proper approach towards this with Rails, is
> there any tutorial for doing something like available on internet/book?

> Which would be better: to pass the comparing model ids to the compare
> controller by post or by url?

> Any tips are highly appreciated.
> --

If I understand correctly you have records in the db and wish to
compare them on demand by the user clicking on a link which goes to a
compare controller.  In this case I would pass the id values as
parameters of a GET request on the compare controller.  It should not
be a POST as it does not cause the data in the db to be changed.  The
actual compare operation should be a method of the model whose objects
are being compared of course.

Colin


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Aljaz Fajmut  
View profile   Translate to Translated (View Original)
 More options 8 Nov, 13:51
From: Aljaz Fajmut <rails-mailing-l...@andreas-s.net>
Date: Sun, 8 Nov 2009 14:51:04 +0100
Local: Sun 8 Nov 2009 13:51
Subject: Re: comparing data
How can you pass array of parameters to GET request?

--
Posted via http://www.ruby-forum.com/.

    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Colin Law  
View profile   Translate to Translated (View Original)
 More options 8 Nov, 14:13
From: Colin Law <clan...@googlemail.com>
Date: Sun, 8 Nov 2009 14:13:16 +0000
Local: Sun 8 Nov 2009 14:13
Subject: Re: [Rails] Re: comparing data
2009/11/8 Aljaz Fajmut <rails-mailing-l...@andreas-s.net>:

> How can you pass array of parameters to GET request?

The same as anything else, eg
if @my_array contains [0,1,2]
<%= link_to 'Compare', :controller => 'compare', :action =>
'do_compare', :ids => @my_array %>

If the values you want to pass come from fields then it just a matter
of setting up the fields correctly.  Google should be able to sort you
out, I always have to look it up.

If you are only comparing two records then just pass the ids as two params.

Colin


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Aljaz Fajmut  
View profile   Translate to Translated (View Original)
 More options 8 Nov, 15:34
From: Aljaz Fajmut <rails-mailing-l...@andreas-s.net>
Date: Sun, 8 Nov 2009 16:34:44 +0100
Local: Sun 8 Nov 2009 15:34
Subject: Re: comparing data

Would it make more sense to make separate controller for comparations or
would it be better to place it inside Plans controller?

Thanks again!
--
Posted via http://www.ruby-forum.com/.


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Colin Law  
View profile   Translate to Translated (View Original)
 More options 8 Nov, 15:48
From: Colin Law <clan...@googlemail.com>
Date: Sun, 8 Nov 2009 15:48:26 +0000
Local: Sun 8 Nov 2009 15:48
Subject: Re: [Rails] Re: comparing data
2009/11/8 Aljaz Fajmut <rails-mailing-l...@andreas-s.net>:

> Would it make more sense to make separate controller for comparations or
> would it be better to place it inside Plans controller?

Whichever makes more sense for you is the way to go.  I think I would
probably put it in a compare action in the Plans controller.

Colin


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
mcescobar1  
View profile   Translate to Translated (View Original)
 More options 8 Nov, 15:17
From: mcescobar1 <dewi...@gmail.com>
Date: Sun, 8 Nov 2009 07:17:29 -0800 (PST)
Local: Sun 8 Nov 2009 15:17
Subject: Re: comparing data
I would do it with nested routes and map.resource. You would end up
with a rout that looked like this:

/plans/:plan_id/compare/:id

If you are comparing more than one at a time then I would do what was
suggested before and pass an array of IDs as a GET request.

On Nov 8, 8:31 am, Aljaz Fajmut <rails-mailing-l...@andreas-s.net>
wrote:


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Al F.  
View profile   Translate to Translated (View Original)
 More options 8 Nov, 16:24
From: "Al F." <rails-mailing-l...@andreas-s.net>
Date: Sun, 8 Nov 2009 17:24:48 +0100
Local: Sun 8 Nov 2009 16:24
Subject: Re: comparing data
What would be the best way to build the GET request url with the
specified plan ids (for instance with form where you can use checkboxes
to set the desired plans)? Would you do it with JS?
--
Posted via http://www.ruby-forum.com/.

    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google