[Rails] Re: Efficient way to prune a table

2009-08-25 Thread Ivor Paul
I''ve taken this approach: def self.prune_table if self.count 1000 youngest_victim = find(:first, :select = :id, :order = 'created_at desc', :offset = 1000) delete_all([id = ?,youngest_victim.id]) end end My requirements are not particularly strict around the 1000. Just more or less

[Rails] Re: Preventing a form from submitting on ENTER

2008-12-30 Thread Ivor Paul
lucky you :) kudos to the staff for all using firefox On Tue, Dec 30, 2008 at 11:26 AM, sa 125 rails-mailing-l...@andreas-s.netwrote: Using and developing exclusively for firefox -- one of the benefits of building a site that'll only be run in an office intranet :) I'll give those a try -

[Rails] Re: Problem with associations that could be null sometimes

2008-12-30 Thread Ivor Paul
Yes, you can :) On Tue, Dec 30, 2008 at 4:49 AM, cassiozen cassio...@gmail.com wrote: Hi Everybody, I'm developing a little task management system with a Task model that belongs to Users and Projects. The problem is that sometimes a task won't belongs to an user AND a project. It will be

[Rails] Re: Preventing a form from submitting on ENTER

2008-12-29 Thread Ivor Paul
How about removing form tags - just have the field and the observe_field this might not be valid html - not sure about that. Ivor On Mon, Dec 29, 2008 at 12:21 PM, sa 125 rails-mailing-l...@andreas-s.netwrote: Hi - I have the following problem: my app has a form that acts as a filter to

[Rails] Re: add an editor on my application

2008-12-29 Thread Ivor Paul
Hi I have limited experience with FCKEditor -- http://www.fckeditor.net/ and slightly more exp with tinymce -- http://tinymce.moxiecode.com/ but in my experience the better solution is to use textile - http://redcloth.org/ http://wiki.rubyonrails.org/rails/pages/RedClothsince they are simpler

[Rails] Re: Shifting query from Controller to Model

2008-12-24 Thread Ivor Paul
Hi Shahroon It looks like you are creating a resource for leads, and that you want to display these leads in the dashboard for your application. What you can do is create a controller for leads. Then you have a resource = :leads. In your routes file you can map the route of your application to

[Rails] Re: Adding to select list

2008-12-24 Thread Ivor Paul
How about refreshing the select list using rjs? On Tue, Dec 23, 2008 at 3:34 PM, Brian Penrose rails-mailing-l...@andreas-s.net wrote: I have several select lists on a form generated via collection_select pulling values from the database. What I would like to do is, if new components need

[Rails] backgroundjob (bj) stopped working

2008-11-19 Thread Ivor Paul
Hi We have been using bj for a while now to upload images to S3 for storage. Everything was running fine, but recently bj has completely stopped working. In the past Bj would just start working when I started mongrel. I found that if I logged into the console and issued Bj.run Bj would run

[Rails] Re: backgroundjob (bj) stopped working

2008-11-19 Thread Ivor Paul
For educational purposes - does no one have an opinion, or did I not qualify this question well enough? I On Wed, Nov 19, 2008 at 2:30 PM, Ivor Paul [EMAIL PROTECTED] wrote: Hi We have been using bj for a while now to upload images to S3 for storage. Everything was running fine

[Rails] Re: backgroundjob (bj) stopped working

2008-11-19 Thread Ivor Paul
will be more than willing to provide additional information - not sure what would help. Thanks for the feedback. Ivor On Wed, Nov 19, 2008 at 5:30 PM, Frederick Cheung [EMAIL PROTECTED] wrote: On 19 Nov 2008, at 15:20, Ivor Paul wrote: For educational purposes - does no one have an opinion, or did I

[Rails] Re: login from token

2008-10-16 Thread Ivor Paul
Thanks for the response. I am using restful_authentication and have the login required process as Thorsten described. What I wanted to do is allow a user to send a message to another user. In the mailer I want to call a method to append a token to that url that is specific to the user who will

[Rails] login from token

2008-10-15 Thread Ivor Paul
Hi I have users sending messages to other users with links in the email. If the users click on the links in the email they go to the message in the app, but invariably they arent logged in and have to do so before getting to the page they want to go to. I want to build a login_from_token