[Rails] Best framework for graphs and charts

2009-04-15 Thread Gu stav

I have some data in a bunch of tables that I would like to display in a
set of graphs. I've been looking at the Google Visualization API, Ziya
and Fusioncharts - they all look nice but it would feel better to go
with something more Rubyesque ;)

So far I've looked at Gruff and Scruffy. Gruff seems to be the most
active of the two.

Any opinions?

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

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Best way and practices to implement search

2009-01-19 Thread Gu stav

I'm trying to implement a search engine to look thru some stuff in my
models. Is there a way I can do something similar to Model.find, but
that is more "forgiving" (poor spelling etc.) and also leverages the
relationships that I've specified (so that it also searches has_many or
belongs_to models)?

Do you have any suggestions on how to implement this. Are there any good
plugins or do I have to write it by myself?

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

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Re: collection_select not selecting default value

2009-01-14 Thread Gu stav


> The first thing that sticks out is it should be :selection_id instead
> of :selection.

that fixes it. thanks a million!
-- 
Posted via http://www.ruby-forum.com/.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] collection_select not selecting default value

2009-01-14 Thread Gu stav

Hi,

I'm trying to create a dropdown using collection_select. However, I cant
seem to get it to select the right option by default.

In my controller I have a setup like this:

@content = Content.new
@content.selection_id = 3
@selections = Selection.find(:all)

In my view I have:

<% form_for :content, @content, :url => { :action => 'create' } do |f|
%>
<%= f.collection_select :selection, @selections, :id, :name %>
<%= submit_tag 'Create' %>
<% end %>

Despite me specifying the default value in the controller,
collection_select doesnt seem to pick that up when rendering the html,
which defaults to the first option in the dropdown.

What idiot-simple thing am I missing? ;)

Thanks!

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

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Re: Find with floats

2008-10-01 Thread Gu stav

I'll give option 3 a shot, just for fun ;) Thanks a million for clearing 
this out!

g.

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

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Re: Find with floats

2008-10-01 Thread Gu stav

I ended up taking the chicken way out, converting my floats to strings 
in new columns and adapting my find conditions to look for those 
instead. Works like charm. Thanks anyways, I wonder why it didnt work.
-- 
Posted via http://www.ruby-forum.com/.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Re: Find with floats

2008-10-01 Thread Gu stav

> Thanks. What would be the correct measure for me to take?
> 
> instead of x == y, you typically want x => y - delta && x <= y + delta
> for some suitable value of delta
> 
> Fred

Ok. Any ideas how I should implement this is my find condition?
-- 
Posted via http://www.ruby-forum.com/.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Re: Find with floats

2008-10-01 Thread Gu stav

> I doubt that would help - that's happening anyway when rails generates
> the query. == Is fundamentally dangerous with floats, almost all the
> time you want to be searching in a range.

Thanks. What would be the correct measure for me to take?
-- 
Posted via http://www.ruby-forum.com/.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Re: Find with floats

2008-10-01 Thread Gu stav

> Short version: using equality with floats isn't a foot idea (not just
> in this case - in general)
> 
> Fred

Should I just convert the floats into strings instead perhaps?
-- 
Posted via http://www.ruby-forum.com/.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Find with floats

2008-10-01 Thread Gu stav

I can't seem to seem to get this find condition to work properly.

I have an object stored in @ip_range, with a float-longitude:

>> @ip_range.lng
=> 11.967

I then want to match this longitude to a City:

>> @city = City.find(:first, :conditions => ["lng = ?", @ip_range.lng])
=> nil

But I know that it should work, since there is a match in the table,
with an id of 4:

@city_debug = City.find(4)
=> #

>> @city_debug.lng
=> 11.967

>> @city_debug.lng == @ip_range.lng
=> true

Something is wrong in my find-condition, but I can't seem to figure out
what it is... maybe something to with floats in find conditions?

Thanks!

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

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---