[Rails] Re: Refactoring and Improving my Rake Task

2009-08-03 Thread bingo bob
Michael, That's superb, like Christmas has come early! I'm going to review all your improvements to understand them and then implement, learned a LOT here. Thanks, will feedback. Follow up question. How would you handle the migration file in my case (for the CSV import I have to create the

[Rails] Re: NoMethodError in User sessionsController#create - Authlogic

2009-08-03 Thread Eric
I wrote an app today that used authlogic 2.1.1 on ruby 1.8.6 just fine. -eric On Aug 2, 8:04 pm, ado adoni...@gmail.com wrote: Hi, I had the same issue - I think it has something to do with the latest version of Authlogic possibly requiring Ruby 1.9???, whereas I'm running 1.8.6 on my dev

[Rails] Re: Refactoring and Improving my Rake Task

2009-08-03 Thread bingo bob
Oh, one other thing. Moving stuff to class methods makes sense I guess as it makes the rakefile cleaner an I guess it's just the right thing to do. Where do I put stuff though and what syntax. I mean so I have a resort.rb in app/models/resort.rb so I guess that's where the fastercsv import

[Rails] Re: Cannot seem to include my own module classes into Rail

2009-08-03 Thread Doug Livesey
Cheers -- I was being a total spoon. All I needed to do was to require it normally -- thought I'd tried that, but must have prepended it with a slash out of habit the first time, or something. Thanks, Doug. -- Posted via http://www.ruby-forum.com/.

[Rails] Re: select helper

2009-08-03 Thread bingo bob
Hi Ram, That looks ideal. Your thinking is absolutely on the right lines in that I'm simply looking for the select to allow the user to jump to the show action of the resorts controller passing in the resort ID. Using Ajax to do this is fine by me. Just a few questions 1) I can't get the

[Rails] How to modify authentication to use against a bespoke database schema

2009-08-03 Thread bradley.kie...@gmail.com
Hi all, I am a little stuck for documentation. I am attempting to use authlogic in a project that is a mini app added to a much larger, established system. This system has a different way of storing user login information coming from multiple tables to that which is defaulted in authlogic. It

[Rails] Re: Background daemon

2009-08-03 Thread Ram
if you had initially set it to sending every hour and then changed it to every day in between, then u may have to re-start the daemon.. did you do that? but i second Michael.. you should be using a cron for this. On Aug 3, 7:47 am, Michael Guterl rails-mailing-l...@andreas-s.net wrote: Penelope

[Rails] Re: select helper

2009-08-03 Thread Ram
This should work %= select_tag :resort_id, option-Select a resort/ option+options_from_collection_for_select (@resorts, :id, :name), :onchange = new Ajax.Request('/resorts/'+ (value), {asynchronous:true, evalScripts:true, method:'get', parameters:'id=' + encodeURIComponent(value)}); % Check the

[Rails] Re: select helper

2009-08-03 Thread Vinay Seshadri
You will need to also send the authenticity token along with Ajax requests if its a request besides a GET request. Module: ActionController::RequestForgeryProtection::ClassMethodshttp://api.rubyonrails.org/classes/ActionController/RequestForgeryProtection/ClassMethods.html Read up on RJS,

[Rails] Re: select helper

2009-08-03 Thread bingo bob
Thanks Gents - am sure that'll be perfect for me, very interesting this Ajax stuff. I'll try it later and report back! bb -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

[Rails] Decimal datatype and trailing zeros

2009-08-03 Thread lucac81
Hello I've encountered a little problem with zeros using the decimal data type Specifying a scale of 3 and inserting a number with 3 zeros after the point (for example 12345.000) it gets correctly stored in the database, but rails insists to show me the number only with the first zero after the

[Rails] Updating attribute based on radio selection

2009-08-03 Thread Tamilselvi Srinivasan
I have a table with question_id , nominees and vote_count in which the values are added manually as follows. ex: question_id nominees vote_count 1tamil 0 1selvi 0 20 30 30 using this i

[Rails] Re: Decimal datatype and trailing zeros

2009-08-03 Thread Franz Strebel
On Mon, Aug 3, 2009 at 11:37 AM, lucac81lcors...@gmail.com wrote: There is a way to tell rails to not truncate at the first zero? You can use sprintf to always force printing up to 3 decimal places, eg sprintf %.3f, the_number --~--~-~--~~~---~--~~ You

[Rails] Re: Decimal datatype and trailing zeros

2009-08-03 Thread Peter De Berdt
On 03 Aug 2009, at 12:20, Franz Strebel wrote: There is a way to tell rails to not truncate at the first zero? You can use sprintf to always force printing up to 3 decimal places, eg sprintf %.3f, the_number Or even better: number_with_precision

[Rails] webcam image capturing

2009-08-03 Thread Sijo Kg
Hi Could anybody please advice me to work with wecamera in Rails. What i want to do is to capture webcam images from a machine and send that data to a remote server there it needs to be processed. I have no idea of where to start.Please help Thanks in advance Sijo -- Posted via

[Rails] Re: select helper

2009-08-03 Thread bingo bob
SO CLOSE ! The select dropdown works fine and I can see from the dev log that it's trying to jump to the show action like this... Completed in 40ms (View: 28, DB: 1) | 200 OK [http://localhost/resorts/15?id=15] But it won't work, that's because I guess I need thte resulting URL to be

[Rails] Re: select helper

2009-08-03 Thread bingo bob
damn i thought i had fixed by simply removing the last bit of the line so it reads.. %= select_tag :id, option-Select a resort/option + options_from_collection_for_select (@resorts, :id, :name), :onchange = new Ajax.Request('/resorts/'+(value), {asynchronous:true, evalScripts:true,

[Rails] Re: select helper

2009-08-03 Thread Vinay Seshadri
You still need to write controller code to respond to ajax requests under the respond_to block @resort = Resort.find(params[:id]) respond_to do |format| format.html #default show.html.erb format.js { redirect_to resort_path(@resort) } end 2009/8/3 bingo bob rails-mailing-l...@andreas-s.net

[Rails] Correct format for errors returned from a REST server?

2009-08-03 Thread John Small
What's the correct format for returning informative errors from a REST server. Error code 500 isn't enough. I want to see a description of the error, but how can I format the XML correctly to put some useful information in. This is a Rails client working with a non-Rails server. Thanks John

[Rails] Re: Updating attribute based on radio selection

2009-08-03 Thread Eddy Josafat
Why are you doing model updating in the view? Can you post the corresponding controller code? You use a loop to read every record in your table, and inside that loop, the line: voting.update_attribute('vote_count', voting.vote_count+1 ) updates every record adding one to the previous value.

[Rails] Re: webcam image capturing

2009-08-03 Thread Sijo Kg
Hi and to be more precise I need something like this http://www.ustream.tv/get-started Sijo -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk

[Rails] Re: select helper

2009-08-03 Thread bingo bob
ok, show in resorts controller now looks like this. def show @resort = Resort.find(params[:id]) respond_to do |format| format.html #default show.html.erb format.js { redirect_to resort_path(@resort) } end end but still no dice ! ? -- Posted via

[Rails] Re: webcam image capturing

2009-08-03 Thread Peter De Berdt
On 03 Aug 2009, at 13:47, Sijo Kg wrote: and to be more precise I need something like this http://www.ustream.tv/get-started http://www.google.com/search?client=safarirls=en-usq=flash+capture+webcamie=UTF-8oe=UTF-8 Best regards Peter De Berdt

[Rails] Activity Log - messages with links - Strategy?

2009-08-03 Thread Ram
Hi all, Im looking to write an activity log as part of the dashboard for one of my apps. The log should show messages like Vinay created the project Acme Inc Website, You completed 2 tasks in the project Acme Inc website and so on. So i went about creating an activities table with

[Rails] Re: Updating attribute based on radio selection

2009-08-03 Thread Tamilselvi Srinivasan
sorry,i have missed to paste the %end% in the post. actually i need to compare the selected nominee with the available nominees . if both are equal then i need to update the vote_count. so only i updated the model in view.. Eddy Josafat wrote: Why are you doing model updating in the view?

[Rails] Re: select helper

2009-08-03 Thread Ram
hmmm.. error messages? log outputs? does the Resort find sql query shoot off? from my experiments, the only workable solution is using render :update.. format.js { render :update do |page| page.redirect_to resort_path(@resort) end } but this actually sounds

[Rails] Re: Updating attribute based on radio selection

2009-08-03 Thread Ram
this post will be useful in understanding the logic you need for this task. stars, css and the works is upto your own discretion.. http://blog.aisleten.com/2007/05/03/ajax-css-star-rating-with-acts_as_rateable/ On Aug 3, 4:58 pm, Tamilselvi Srinivasan rails-mailing-l...@andreas- s.net wrote:

[Rails] Re: select helper

2009-08-03 Thread bingo bob
a,, seems like its doing it multiple times.. wierd..notice the time stamps. never does get me to the show action though. Processing ResortsController#show (for 127.0.0.1 at 2009-08-03 13:29:06) [GET] Parameters: {id=18} Resort Load (0.7ms) SELECT * FROM resorts WHERE (resorts.id =

[Rails] Re: select helper

2009-08-03 Thread Ram
Do you still have format.html ? render :update works for me. and i cant think of a cleaner way to do this.. On Aug 3, 5:31 pm, bingo bob rails-mailing-l...@andreas-s.net wrote: a,, seems like its doing it multiple times.. wierd..notice the time stamps. never does get me to the show

[Rails] Re: Correct format for errors returned from a REST server?

2009-08-03 Thread rogerdpack
On Aug 3, 5:31 am, John Small rails-mailing-l...@andreas-s.net wrote: What's the correct format for returning informative errors from a REST server. Error code 500 isn't enough. I want to see a description of the error, but how can I format the XML correctly to put some useful information

[Rails] Re: Is there a way to support moneybookers in activemerchant

2009-08-03 Thread rogerdpack
http://groups.google.com/group/activemerchant might help. =r On Aug 2, 5:56 am, gaoxt1983 gaoxtwarr...@gmail.com wrote: I'm not quite familiar with online payment. Is there anyone can enlighten me with detail? --~--~-~--~~~---~--~~ You received this message

[Rails] Re: select helper

2009-08-03 Thread bingo bob
PHEW. Works ! :-) thanks. with render :update that is. ta -- 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

[Rails] Re: Proxy settings for rails apps

2009-08-03 Thread Roger Pack
Ritvvij wrote: My app calls a few web services. Sometimes when I move my laptop to a proxy-ed internet area, the rails app fails. Do I need special settings for proxy? Unless the proxy can be magic and pick up the requests for you, you'll need to somehow use the proxy server instead of

[Rails] Re: Where to require openssl?

2009-08-03 Thread Roger Pack
Fernando Perez wrote: Hi, In one of my models I need to use openssl, but I don't know where to place the: -- require 'openssl' -- statement? I'd put it in config/environment.rb -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received

[Rails] Re: threadsafe! engines

2009-08-03 Thread Roger Pack
Tyler Jennings wrote: I'm having a problem with rails 2.3.2, engines, and eager loading. There is a default set of eager_load_paths (the usual suspects under app/) that will be greedily required by rails at boot time when you're running with threadsafe! on, and of course you can append your

[Rails] Re: Sharing Gems and Ruby Interpreter among application serv

2009-08-03 Thread Roger Pack
Did anyone try that or has a suggestion or experience with shared libraries among servers in a network? Maybe its performancewise a disaster or there are other arguments against this idea. Probably not a problem performance-wise, just kind of pain to configure :) I think there is a way to

[Rails] Re: Speed comparison between mac/linux and windows

2009-08-03 Thread Roger Pack
I was wondering if anything has changed since then (2008) and if rails/ ruby is comparable performance wise on windows nowadays? A quick search on the internet did not turn up anything past late 2008. It is still slower in windows, though less so if you use the mingw builds of ruby.

[Rails] Re: Could not find RubyGem rack (~ 1.0.0) (Gem::LoadError)

2009-08-03 Thread Roger Pack
error': Could not find RubyGem rack (~ 1.0.0) (Gem::LoadError) from gem install rake? however, it should have installed rake gem because rake gem is a dependency of rails, so...maybe gem install rails will get you the right version. =r -- Posted via http://www.ruby-forum.com/.

[Rails] Re: New to Rails? Read This

2009-08-03 Thread Alpha Blue
== Rescue and Redirects == There are a lot of times that you'll find when you perform a query on your database that no records are found. Some people that are new to rails might do something like: if model.find(:all).empty? .. do

[Rails] Re: Decimal datatype and trailing zeros

2009-08-03 Thread lucac81
On Aug 3, 12:29 pm, Peter De Berdt peter.de.be...@pandora.be wrote: On 03 Aug 2009, at 12:20, Franz Strebel wrote: There is a way to tell rails to not truncate at the first zero? You can use sprintf to always force printing up to 3 decimal places, eg  sprintf %.3f, the_number Or

[Rails] Re: Missing mislav-will_paginate - *SOLVED*

2009-08-03 Thread Rob Biedenharn
On Aug 2, 2009, at 2:20 PM, Eric wrote: On Aug 2, 10:22 am, Michael Satterwhite rails-mailing-l...@andreas- s.net wrote: Check outhttp://www.rubygems.org/read/chapter/1for details on what's going on here. It's working now. Thanks to all who helped. I especially appreciate the

[Rails] Plugins / libraries for user-specific CSS?

2009-08-03 Thread Zee
Hi all, I'm creating a social networking site which (obviously) will be mostly user-created content. I'd like for users to also be able to have some control over the look of the site - ie for them to choose 'skins' or create a custom stylesheet overriding some of the basic CSS attributes so they

[Rails] Re: Rails app going nuts at 100% cpu

2009-08-03 Thread Fernando Perez
I have reactivated my whole application, except rcov_plugin for which I had not installed the gem on the production server. I don't if that's the cause, but now my app has been running flawlessly as if nothing ever happenned... -- Posted via http://www.ruby-forum.com/.

[Rails] Re: For GIS applications

2009-08-03 Thread Marnen Laibow-Koser
Sijo Kg wrote: Hi Yes I want to draw maps, dealing with geocoded data, I've been using YM4R for that. I've only dealt with Google Maps, but I understand that Mapstraction is very helpful if you're dealing with multiple mapping services. As exacltly according to the latlong

[Rails] Re: New to Rails? Read This

2009-08-03 Thread Marnen Laibow-Koser
Alpha Blue wrote: [...] This is where rescue is a great feature that rails has implemented into it. Actually, it's a basic Ruby feature. How do you use it? Here's an example: def get_products(product_id) begin @products = Product.find(product_id) rescue

[Rails] Re: Activity Log - messages with links - Strategy?

2009-08-03 Thread Marnen Laibow-Koser
Ram wrote: Hi all, Im looking to write an activity log as part of the dashboard for one of my apps. The log should show messages like Vinay created the project Acme Inc Website, You completed 2 tasks in the project Acme Inc website and so on. So i went about creating an activities

[Rails] Re: ActionController::RoutingError (No route matches /say/hello with {:method=:get}):

2009-08-03 Thread Chris
Thank you for your reply. I guess I will have to live with it when I am adding new controllers without restful routes (not sure what that is but I'm about to go look now!). I guess for someone who was looking for a change from Tomcat and Java and was really exited about not having to restart his

[Rails] Re: For GIS applications

2009-08-03 Thread Colin Law
2009/8/3 Marnen Laibow-Koser rails-mailing-l...@andreas-s.net: Sijo Kg wrote: Hi  Yes I want to draw maps, dealing with geocoded data, I've been using YM4R for that.  I've only dealt with Google Maps, but I understand that Mapstraction is very helpful if you're dealing with multiple

[Rails] object.collections.include? a

2009-08-03 Thread Mark Ron
My question is about object.collections (AssociationProxy). We all know that it pretends to be an Array, but in reality it's actually an AssociationProxy. But, Why does it have its own db intensive include? method? Example: @product = Product.find 1 (product habtm categories) We have 1000

[Rails] Re: site redirection

2009-08-03 Thread fRAnKEnSTEin
hi, ok i tryed with RedirectMatch 301 ^/(.*) http://.../$1 and it does not worked, in fact this solution loads the site without any css. I am using the htaccess located in the public folder, do i have to configure something else for doing this Cheers On 31 jul, 18:40, Tim W

[Rails] error loading rubygems from vendor_gem_source_index

2009-08-03 Thread Adam Wilson
I'm having trouble running script/generate due to the following error: ./script/../config/../vendor/rails/railties/lib/rails/vendor_gem_source_index.rb:1:in `require': No such file to load -- rubygems (LoadError) from

[Rails] Re: site redirection

2009-08-03 Thread fRAnKEnSTEin
another thing i am using passenger for my app, maybe passenger do not like .htaccess in public directory...no idea??? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this

[Rails] Json views

2009-08-03 Thread Nicholas Wieland
Hi *, I'm writing an API for my application, but I can't figure out how to behave with the json frontend, where I need to do something like @object.image.url. Should I write a .json view or there's some special method for this kind of problems ? I see to_json has a handy methods option that

[Rails] Re: site redirection

2009-08-03 Thread fRAnKEnSTEin
even if i delete the htaccess(some say that passenger dont like htaccess) does not work --~--~-~--~~~---~--~~ 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

[Rails] Re: Json views

2009-08-03 Thread Michael Schuerig
On Monday 03 August 2009, Nicholas Wieland wrote: Hi *, I'm writing an API for my application, but I can't figure out how to behave with the json frontend, where I need to do something like @object.image.url. Should I write a .json view or there's some special method for this kind of

[Rails] Re: For GIS applications

2009-08-03 Thread Marnen Laibow-Koser
Colin Law wrote: [...] I have a problem with YM4R however. The concept there is to construct the map object in the controller and then display it in the view. It's been a while since I've touched that part of my codebase, so I had temporarily forgotten that. I'm actually no longer quite

[Rails] Using Select Helper

2009-08-03 Thread Andrew Pace
I am having trouble getting the form select helper to use non-numeric values. The form is pasted below... I want the f.select to have values home, category, etc, not numeric values like shown. However, it does not seem to work to use [Home Page, 'home']. From what I can find in the guides,

[Rails] Re: Using Select Helper

2009-08-03 Thread Andrew Pace
Please ignore. It was a problem with my migration file. Thanks --~--~-~--~~~---~--~~ 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

[Rails] Re: site redirection

2009-08-03 Thread heimdull
I would use mod_rewrite and not mod_alias (RedirectMatch) for this task, and here is a example that will make sure you stay with www. # Force www.cadechristian.com RewriteCond %{HTTP_HOST} !^www\.cadechristian\.com [NC] RewriteRule ^/(.*) http://www.cadechristian.com/$1 [L,R=301] This

[Rails] Re: Missing mislav-will_paginate - *SOLVED*

2009-08-03 Thread Billee D.
Yes, that is correct. In my environment.rb file it is listed as :version = '~ 2.2.3' but I removed that hash key so there is no reference to a version number. HTH! William On Aug 2, 2:20 pm, Eric ericgh...@gmail.com wrote: On Aug 2, 10:22 am, Michael Satterwhite rails-mailing-l...@andreas-

[Rails] Re: site redirection

2009-08-03 Thread fRAnKEnSTEin
in fact my first attempt was exactly what heimdull suggest. But it does not worked. I think this has to be somthing related with passengerany other ideas? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Ruby on

[Rails] Re: threadsafe! engines

2009-08-03 Thread Tyler Jennings
Pinged core, it's a bug. On Mon, Aug 3, 2009 at 7:55 AM, Roger Packrails-mailing-l...@andreas-s.net wrote: Tyler Jennings wrote: I'm having a problem with rails 2.3.2, engines, and eager loading. There is a default set of eager_load_paths (the usual suspects under app/) that will be

[Rails] Re: For GIS applications

2009-08-03 Thread Colin Law
2009/8/3 Marnen Laibow-Koser rails-mailing-l...@andreas-s.net: Colin Law wrote: [...] I have a problem with YM4R however.  The concept there is to construct the map object in the controller and then display it in the view. It's been a while since I've touched that part of my codebase, so I

[Rails] Re: object.collections.include? a

2009-08-03 Thread Frederick Cheung
On Aug 3, 5:40 pm, Mark Ron rails-mailing-l...@andreas-s.net wrote: Why doesn't it use the include? method of the Array? (way faster and doesn't need db queries at all, since the association is already loaded.) Why does it need its own include? method? Presumably the association isn't

[Rails] Re: New to Rails? Read This

2009-08-03 Thread Alpha Blue
Marnen Laibow-Koser wrote: Um, WTF? That's where logic is supposed to go. Exception handling supplements that logic; it doesn't replace it. There are times when it might be necessary (methods that involve rake tasks etc. come to mind) but overall, rescue is something everyone new to

[Rails] Rails Database Query

2009-08-03 Thread Nick
Hi, I'm having trouble creating the right code to query the following: - I have a table of trails and a table of trailreports - trails has a hasmany relationship with trailreports - trailreports has a field trail_id, report and created_at field. I would like to query the list of trails that

[Rails] I'm not sure what happened with my app - ActiveRecord Query

2009-08-03 Thread Alpha Blue
Everything was working perfectly. I ran a few tests this morning in development and found a few errors and corrected them. Another thing I did was clear out old data in 4 tables. 3 of these tables are now having the same issue using the following query: week_start_date

[Rails] Re: I'm not sure what happened with my app - ActiveRecord Query

2009-08-03 Thread Alpha Blue
Test One: week_start_date =Time.now.beginning_of_week.to_date.strftime('%Y-%m-%d') week_end_date = Time.now.end_of_week.to_date.strftime('%Y-%m-%d') compiled_on = week_start_date..week_end_date tsos_offense = Team.find(10,1, :joins = [:tsos_offenses], :conditions = {:tsos_offenses =

[Rails] Re: object.collections.include? a

2009-08-03 Thread Mark Ron
Frederick Cheung wrote: On Aug 3, 5:40�pm, Mark Ron rails-mailing-l...@andreas-s.net wrote: Why doesn't it use the include? method of the Array? (way faster and doesn't need db queries at all, since the association is already loaded.) Why does it need its own include? method? Presumably

[Rails] Re: New to Rails? Read This

2009-08-03 Thread s.ross
Hello-- On Aug 3, 2009, at 12:50 PM, Alpha Blue wrote: Marnen Laibow-Koser wrote: Um, WTF? That's where logic is supposed to go. Exception handling supplements that logic; it doesn't replace it. There are times when it might be necessary (methods that involve rake tasks etc. come to

[Rails] Re: Rails app going nuts at 100% cpu

2009-08-03 Thread Fernando Perez
Yeah buddy!!! Lightweight! It finally failed 7 hours and 40 minutes after my last update! I'm feeling lucky, because it's a tie break between 2 things: acts_as_list plugin (which might be clashing with acts_as_list) and my sitemap generator. This week long investigation and hunt will finally

[Rails] Best Practice: Automatic session timeout/cleanup?

2009-08-03 Thread Phoenix Rising
I'm developing an application where I need to have all sessions that have been inactive for X minutes (in this case, I'm thinking 10 minutes, but I'm flexible to a point) automatically purged from the database (using ActiveRecord session store). What I've done is created a simple rake task that

[Rails] Re: Rails app going nuts at 100% cpu

2009-08-03 Thread Fernando Perez
Sorry, should read: acts_as_tree might be the trouble maker. -- 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

[Rails] Re: Best Practice: Automatic session timeout/cleanup?

2009-08-03 Thread James Englert
What is your motivation for removing these rows at all? Generally, large database tables that are properly indexed shouldn't pose much of a performance concern. On Mon, Aug 3, 2009 at 3:45 PM, Phoenix Rising polarisris...@gmail.comwrote: I'm developing an application where I need to have all

[Rails] Re: Rails Database Query

2009-08-03 Thread Marnen Laibow-Koser
Nick wrote: Hi, I'm having trouble creating the right code to query the following: - I have a table of trails and a table of trailreports - trails has a hasmany relationship with trailreports - trailreports has a field trail_id, report and created_at field. I would like to query the

[Rails] Re: Rails app going nuts at 100% cpu

2009-08-03 Thread Marnen Laibow-Koser
Fernando Perez wrote: Sorry, should read: acts_as_tree might be the trouble maker. soapbox You probably want awesome_nested_set anyway. /soapbox Good luck with the rest of the tracking. I'm not sure I'd have the patience for all the stuff you've done! Best, -- Marnen Laibow-Koser

[Rails] Re: site redirection

2009-08-03 Thread fRAnKEnSTEin
i have created atest folder inside my application publuc folder. Inside test foler i have created one .htaccess file that redirects to www.yahoo.com when i point my browser to it, redirects me to yahoo. But this htacces does not work inside my app's public folder, it just do not do the

[Rails] Re: Rails Database Query

2009-08-03 Thread Robby Russell
Something along the lines of... Trail.find(:all, :include = [:trailreports], :order = ['trailreports.created_at DESC']) On Mon, Aug 3, 2009 at 12:57 PM, Nicknhi...@gmail.com wrote: Hi, I'm having trouble creating the right code to query the following: - I have a table of trails and a

[Rails] Re: For GIS applications

2009-08-03 Thread Marnen Laibow-Koser
Colin Law wrote: [...] I am suggesting that the map is not to be treated as an object any more than a table is in a view. It is just a particular way of viewing a set of markers, waypoints etc. Yes, that was sort of what I had in mind when I was talking about markers being primary. [...]

[Rails] [ANN] ri_cal 0.7.5 Released

2009-08-03 Thread Rick DeNatale
ri_cal version 0.7.5 has been released! * http://ri-cal.rubyforge.org/ * by Rick DeNatale A new Ruby implementation of RFC2445 iCalendar. The existing Ruby iCalendar libraries (e.g. icalendar, vpim) provide for parsing and generating icalendar files, but do not support important things like

[Rails] Re: Refactoring and Improving my Rake Task

2009-08-03 Thread Michael Guterl
bingo bob wrote: Oh, one other thing. Moving stuff to class methods makes sense I guess as it makes the rakefile cleaner an I guess it's just the right thing to do. Where do I put stuff though and what syntax. I mean so I have a resort.rb in app/models/resort.rb so I guess that's where

[Rails] Re: Best Practice: Automatic session timeout/cleanup?

2009-08-03 Thread Hassan Schroeder
On Mon, Aug 3, 2009 at 12:45 PM, Phoenix Risingpolarisris...@gmail.com wrote: I'm developing an application where I need to have all sessions that have been inactive for X minutes (in this case, I'm thinking 10 minutes, but I'm flexible to a point) automatically purged from the database

[Rails] Re: Best Practice: Automatic session timeout/cleanup?

2009-08-03 Thread s.ross
On Aug 3, 2009, at 4:53 PM, Hassan Schroeder wrote: On Mon, Aug 3, 2009 at 12:45 PM, Phoenix Risingpolarisris...@gmail.com wrote: I'm developing an application where I need to have all sessions that have been inactive for X minutes (in this case, I'm thinking 10 minutes, but I'm

[Rails] Re: I'm not sure what happened with my app - ActiveRecord Query

2009-08-03 Thread Alpha Blue
I moved the three tables to selects and the response time difference is negligible about 50ms for the entire routine. It also keeps the entire routine formalized and uniform. -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this

[Rails] Re: Best Practice: Automatic session timeout/cleanup?

2009-08-03 Thread Alpha Blue
Shouldn't your session timeouts and whatnot be handled by your server instead? -- 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

[Rails] Re: Best Practice: Automatic session timeout/cleanup?

2009-08-03 Thread Hassan Schroeder
On Mon, Aug 3, 2009 at 5:17 PM, s.rosscwdi...@gmail.com wrote: Well, what you are both looking at doing is: Session.delete_all, :conditions = ['updated_at ?', 10.minutes.ago] That translates into a pretty quick database query, depending on the number of sessions you anticipate having.

[Rails] Re: I'm not sure what happened with my app - ActiveRecord Query

2009-08-03 Thread Jeremy Kemper
On Mon, Aug 3, 2009 at 5:35 PM, Alpha Bluerails-mailing-l...@andreas-s.net wrote: I moved the three tables to selects and the response time difference is negligible about 50ms for the entire routine.  It also keeps the entire routine formalized and uniform. Write some unit tests now to ensure

[Rails] Re: rake db:create = LIBMYSQL.DLL not found. how to solve??

2009-08-03 Thread Vicer Ontero
I just experienced the same problem and after a Google on the phrase, the general consensus among those who offered solutions worked for me also. It seems that MySQL 5.1 does not play well with Ruby. I resolved this by downloading the 5.0 version. More specifically:

[Rails] Re: Best Practice: Automatic session timeout/cleanup?

2009-08-03 Thread Phoenix Rising
What is your motivation for removing these rows at all? Generally, large database tables that are properly indexed shouldn't pose much of a performance concern. The reasoning behind this is that I want old sessions that are inactive for 10 minutes to be terminated automagically. It's a

[Rails] Correctly upgrading ruby on MS Windows

2009-08-03 Thread RubyNewbie
Hi, I am looking for some guidance on the correct and/or most streamlined way to upgrade Ruby. Presently I am on Ruby version 1.8.6 patch level 111. I am looking to upgrade to version 1.8.6 patch level 287. When I tried downloading the ruby-1.8.6-p287-i386-mswin32.zip file I unzipped it and was

[Rails] Authlogic::How to access current user from within a cache sweeper?

2009-08-03 Thread JL Smith
So I'm trying to follow along in Chad Fowler's Rails Recipes (recipe #59, Keeping track of who did what) and I simply want to access the current user from within my cache sweeper. Normally you just reference @current_user but that doesn't seem to be the case here. In Chad's example, he calls

[Rails] Re: Best Practice: Automatic session timeout/cleanup?

2009-08-03 Thread s.ross
Hello-- On Aug 3, 2009, at 5:55 PM, Phoenix Rising wrote: What is your motivation for removing these rows at all? Generally, large database tables that are properly indexed shouldn't pose much of a performance concern. The reasoning behind this is that I want old sessions that are

[Rails] Re: Hi doubt in unit testing

2009-08-03 Thread karthik k
Hi Colin the name field is made as validates_uniqueness_of :name so please let me know what i did is right or wrong though the name is different it is providing the error message Is this the right way to check uniqueness I got the information from from

[Rails] Passenger, switching from development to production

2009-08-03 Thread Craig White
It appears my http setup is working but I am getting an error when I try to use a web browser to connect. All I have done so far is to change the setting from what was working in httpd.conf and move it to ssl.conf (adding some ssl things) and I am using the same directory/set of files that was

[Rails] Rails sites

2009-08-03 Thread Sijo Kg
Hi Could you please give list of some popular sites which handle very huge data than twitter and more faster than that? Thanks in advance Sijo -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are

[Rails] [Job] Rails expert programmers needed for Canadian company

2009-08-03 Thread vanquisher
Hi folks, Castle Rock Research Corp (http://www.castlerockresearch.com/) is looking for talented Senior Web Developers with a history of commercial product consumer-oriented web application design and high- end development and exposure to the full project life cycle. Should have Outstanding

[Rails] Re: Activity Log - messages with links - Strategy?

2009-08-03 Thread Ram
Nice.. that seems like a good option. So assuming that im gonna use link_to to generate the HTML, I will have to generate the message in either the controller or view right? was hoping i could generate the message in the model keeping the controller clean. anyway, ill get on that. anymore ideas

[Rails] ActiveResource xml element ordering

2009-08-03 Thread Slava Mikerin
Hello, I am using ActiveResource to integrate with a 3rd party service. when calling MyModel.save a POST with xml is sent. I need to make sure that xml is created with defined order of elements (the service requires it) How can I do that? Some have suggested using rxml or builder, but I am not