[Rails] Re: Cutting Edge Technologists wanted

2008-10-19 Thread Pau Cor
Jay S'duc wrote: > Hi All, > > If you have Ruby on Rails experience and fancy a change of scenery then > feel free to call me on 020 8254 7487. > > I am excellent at finding great RoR Developers new opportunities. > > Get in touch It sounds like you are advertising your company's (http://www.

[Rails] Re: Using captcha

2008-10-19 Thread Abhishek shukla
User simple_captcha Below is the link http://expressica.com/simple_captcha/ regards Abhi.. On Sun, Oct 19, 2008 at 11:04 AM, Indu RS <[EMAIL PROTECTED]>wrote: > > > > Hello everyone, > I'm trying to implement Captcha in my program.Anyone will > please give me suggestion for using the

[Rails] Liquid_markup for rails

2008-10-19 Thread Tushar Gandhi
Hi, I have some problem to understand "Liquid_markup" plugin. I searched on net but still I am not able to understand what is the use of this plugin? Thanks, Tushar -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message bec

[Rails] Re: Ensuring both objects in a one-to-many association are not saved without the presence of the ot

2008-10-19 Thread Evan
I guess the question I was really getting at is how can I validate the presence and association of both objects before they are saved? I feel more confident when there is code in the model itself to ensure the integrity of the data rather than depending on each programmer to place every save in a

[Rails] Re: error_messages_for question..

2008-10-19 Thread Jay Pangmi
Craig Demyanovich wrote: > Instead of > > <%= error_messages_for 'customer' %> > > which is telling error_messages_for to display errors for the string > 'customer', which I don't expect to ever work, you should probably use > > <%= error_messages_for @customer %> > > assuming that your contro

[Rails] Re: Ensuring both objects in a one-to-many association are not saved without the presence of the ot

2008-10-19 Thread Evan
Oh wait. I think I just got it. Start a transaction, save the primary object thus getting the id, save the secondary object, end transaction. Right? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk

[Rails] Re: Ensuring both objects in a one-to-many association are not saved without the presence of the ot

2008-10-19 Thread Evan
Even with transactions can I save the object containing the foreign key without saving the primary object first? In other words, can I save the object that requires the foreign key to be present if I don't have the foreign key because the primary object has not yet been saved, thus generating an i

[Rails] Re: Good caching books (esp. memcache)

2008-10-19 Thread Thani Ararsu
Luke Grimstrup wrote: > I'm currently working on a project that is under-going some major > scaling, and we have a few people on board who are speeding up the site > and using memcached for a lot of things. > > Can anyone recommend some good RoR Site Optimization books that have a > somewhat larg

[Rails] Re: Ensuring both objects in a one-to-many association are not saved without the presence of the ot

2008-10-19 Thread Thani Ararsu
Evan wrote: > Hello. > > I have an object which is related to a second object through has_many. > The second object (obviously) is related to the first through > belongs_to. I want to ensure that neither object is saved to the > database without the presence of the other. How can I do this? > >

[Rails] Ensuring both objects in a one-to-many association are not saved without the presence of the other

2008-10-19 Thread Evan
Hello. I have an object which is related to a second object through has_many. The second object (obviously) is related to the first through belongs_to. I want to ensure that neither object is saved to the database without the presence of the other. How can I do this? Thanks. Evan --~--~

[Rails] Good caching books (esp. memcache)

2008-10-19 Thread Luke Grimstrup
I'm currently working on a project that is under-going some major scaling, and we have a few people on board who are speeding up the site and using memcached for a lot of things. Can anyone recommend some good RoR Site Optimization books that have a somewhat large emphasis on memcached? TIA --

[Rails] Re: rspec fails when assigning to an ActiveRecord field

2008-10-19 Thread David Chelimsky
On Wed, Oct 15, 2008 at 11:48 PM, leo <[EMAIL PROTECTED]> wrote: > > HI, > I have a controller action that assigns a user_id to an event record. > The app works fine from the browser. However, rspec fails and I > cannot figure out why. I have several tests failing but I'll give an > example crea

[Rails] Fillable PDF

2008-10-19 Thread Simon Macneall
Hi peoples, Does anyone have any knowledge of a ruby library for extracting fields from fillable PDFs? We have some that generate XFDF (which is just XML) that I can extract fine, but I don't really want to have to write a parser for the FDF format. Cheers Simon --~--~-~--~~-

[Rails] render file in a new browser tab

2008-10-19 Thread Vicky Shaw
Is there any way I can render or send_file in a new browser tab or browser window? - Vicky -- 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 p

[Rails] Re: Postgres adapter issues with Rails 2.1: ruby-pg is the answer!

2008-10-19 Thread Tim Uckun
> -- > Building native extensions. This could take a while... > ERROR: Error installing ruby-pg: >ERROR: Failed to build gem native extension. > I had the same problem. I have some additional questions. Why is the "official" postgres gem for rails ruby-pr when it doesn't work on wind

[Rails] Need Feedback Please

2008-10-19 Thread Yottameter
Is this recommended to use: http://agilewebdevelopment.com/plugins/restful_authentication or is this sorta like login engine, and it's going to be gone soon. or is there some 'newer' version out that I'm not aware of? Really what I'm looking for is to just create users, sessions and manage them

[Rails] Re: Use of validates_uniqueness_of for create but not for e

2008-10-19 Thread Ismail Degani
Hi, The reason you're getting this error is because the "validates" functions are class level methods, whereas your check_duplicate function is an instance method. So, to fix this, just reference the "validates_" methods with the appropriate model name: def check_duplicate User.validates_un

[Rails] accessing bcc recipients in ActionMailer view

2008-10-19 Thread Greg
Apologies if this has been covered already, but I haven't been able to turn anything up after a bit of searching. I have an app that sends out a mail to a large bcc list. I'd like to be able to add some personalization to the mail (you know, something like "Hi, person X, thanks for being on our hu

[Rails] ActionWebService

2008-10-19 Thread akbet
Good Day, I use ActionWebService for creation Blog API trough creation XMLRPC controller class XmlrpcController < ApplicationController web_service_dispatching_mode :layered web_service(:blogger) { BloggerService.new() } end class BloggerAPI < ActionWebService::API::Base inflect_nam

[Rails] Apps for Democracy Contest $20,000 in Prizes

2008-10-19 Thread corbett3000
Hi All, I thought you might like to know about a contest where having here in DC for web app dev that mashes-up DC.gov's public data. It's open to all. Here's the info: Apps for Democracy will feature 60 cash prizes from $2000 to $100 dollars for a total of $20,000 in prizes. Developers and desi

[Rails] Re: How do I only show items that belong to a certain user?

2008-10-19 Thread Walter McGinnis
Oh, I should say that I'm not sure what the actual user variable is when using restful_authentication, but that is the concept you want to go for. Cheers, Walter > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ru

[Rails] Re: How do I only show items that belong to a certain user?

2008-10-19 Thread Walter McGinnis
@current_user.documents rather Document.find(:all). Cheers, Walter McGinnis --~--~-~--~~~---~--~~ 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@googlegrou

[Rails] How do I only show items that belong to a certain user?

2008-10-19 Thread David Smit
I have a web application with users and their documents. Each user can have many documents: user.rb: has_many :documents document.rb: belongs_to :user document_controller.rb: def index @documents = Document.find(:all) end I am using the restful_authentication plugin. Here is my question

[Rails] Re: multi-select category listbox

2008-10-19 Thread Freddy Andersen
select_tag “article[category_ids][]“, options_from_collection_for_select(@available_categories, “id”, “name”), :multiple=>true That should create a select box with multiple selected elements... --~--~-~--~~~---~--~~ You received this message because you are subscri

[Rails] inconsistency in calling to_xml on STI returning

2008-10-19 Thread Zhao Lu
Hi, When calling to_xml on STI that returns heterogeneous type of records, each record is contained in node. For example, if I have Account with subclasses EmailAccount and PhoneAccount, Account.find(:all).to_xml gives me: When calling to_xml on homogeneous type of records, each reco

[Rails] Destroy Action

2008-10-19 Thread Keith
Hi Everyone, I have just created a destroy action in my controller, it was working fine about 2 hours ago and now for some reason it has stopped working. Once I click on destroy I receive ' Unknown action No action responded to destroy'. The action that I want it to redirect to is 'list' and thi

[Rails] multi-select category listbox

2008-10-19 Thread John Griffiths
Hi, on to the final bit of my blogging engine and would really appreciate a pointer in the right direction. With each article they can be associated with multiple categories, so inside the admin panel I need to somehow have a listbox that allows users to select multiple categories and associated

[Rails] Database architecture for a multi-organization application

2008-10-19 Thread Ginty
Hi All, I am a newbie to RoR and to be honest web development in general, although I do have some experience of creating PHP and mySQL driven applications in the past. Anyway at this stage I am still following relatively basic RoR tutorials but at the same time I am trying to envision how what I

[Rails] Trouble validating associated objects

2008-10-19 Thread Md. Kazim Zaidi
Hello everyone, This is my first post to this list, so kindly remind me if I do something wrong. :-P When parent objects are saved, all the new children are saved. However, when the child objects validate themselves, they fail because the foreign key is nil. Domain logic in my application require

[Rails] Re: Import of YAML files during rake?

2008-10-19 Thread [EMAIL PROTECTED]
I hate it when people think out of the box, and comes up with a perfect simple solution. Perfect, thanx for the help. regards svend On Oct 19, 2:19 am, Daniel <[EMAIL PROTECTED]> wrote: > On Oct 19, 6:13 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> > wrote: > > > Thanx, but using fixtures_create

[Rails] Re: Postgres adapter issues with Rails 2.1: ruby-pg is the answer!

2008-10-19 Thread Fernando Perez
On my Debian Etch box I have installed PostgreSQL from backports repo. When I want to install ruby-pg with "gem1.8 install ruby-pg", I get the following error: -- Building native extensions. This could take a while... ERROR: Error installing ruby-pg: ERROR: Failed to build gem native e

[Rails] Re: new to this group

2008-10-19 Thread Daniel Moore
On Oct 17, 6:08 pm, Thiru <[EMAIL PROTECTED]> wrote: > hi.. >  am thirugnanam, am new to this group i want to do the web development > wil u plz give the details.. am passed out of this year B.tech IT i > want to do the open source in this ruby plz teach me to do this I love every word of wha

[Rails] Re: Preferred adapter for PostgreSQL 8.3 on Rails 2.0.2

2008-10-19 Thread Fernando Perez
Holy crap!!! How can I install ruby-pg when PostgreSQL is on another box? The gem won't build without the --include=/... I want to keep PostgreSQL and my Rails app separated. I am running Debian Etch. Do I compulsory need to install a copy of the package postgresql on my Rails server without a

[Rails] Advice on model design

2008-10-19 Thread nick
I've got an application with 2 related models. I want to search for data based on conditions in both models. I want to return items from the first model (Contract) grouped by conditions in the second (Status) At the moment, I'm basically doing it as shown below. It seems really ugly. Any suggesti

[Rails] Re: Preferred adapter for PostgreSQL 8.3 on Rails 2.0.2

2008-10-19 Thread Fernando Perez
For some strange reason, if I specify: -- config.gem 'ruby-pg' -- in environment.rb, Rails can't find the gem although it is installed on the system. Any idea? -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you

[Rails] Re: Regular Expression Grouping

2008-10-19 Thread Marcelino Debajo
thanks Fred. I think I misunderstood something. On Mon, Oct 20, 2008 at 12:14 AM, Frederick Cheung <[EMAIL PROTECTED]> wrote: > > > On 19 Oct 2008, at 16:04, Marcelino Debajo wrote: > >> >> Yeah you're right, >> >>> match = 'Today is Feb 23rd, 2003'.match(/Feb 23(rd)??/) >>> match[0] #=> "Feb 23

[Rails] Re: Regular Expression Grouping

2008-10-19 Thread Frederick Cheung
On 19 Oct 2008, at 16:04, Marcelino Debajo wrote: > > Yeah you're right, > >> match = 'Today is Feb 23rd, 2003'.match(/Feb 23(rd)??/) >> match[0] #=> "Feb 23" >> match[1] #=> nil > > I expected: > >> match = 'Today is Feb 23rd, 2003'.match(/Feb 23(rd)?/) # ? is >> greedy here >> match[0] #

[Rails] Re: Regular Expression Grouping

2008-10-19 Thread Marcelino Debajo
Yeah you're right, > match = 'Today is Feb 23rd, 2003'.match(/Feb 23(rd)??/) > match[0] #=> "Feb 23" > match[1] #=> nil I expected: > match = 'Today is Feb 23rd, 2003'.match(/Feb 23(rd)?/) # ? is greedy here > match[0] #=> "Feb 23rd" > match[1] #=> nil But what I got in ruby 1.8.6 (2007-09

[Rails] Regular Expression Grouping

2008-10-19 Thread mars
Hi! I couldn't understand the behavior of this code: match = 'Today is Feb 23rd, 2003'.match(/Feb 23(rd)?/) a = match.to_a puts a.size# 2 puts a.join(",") # Feb 23rd,rd puts a[0] # Feb 23rd puts a[1] # rd In my understanding, /F

[Rails] Re: Regular Expression Grouping

2008-10-19 Thread Frederick Cheung
On 19 Oct 2008, at 15:01, mars wrote: > > Hi! > > I couldn't understand the behavior of this code: > > match = 'Today is Feb 23rd, 2003'.match(/Feb 23(rd)?/) > a = match.to_a > puts a.size# 2 > puts a.join(",") # Feb 23rd,rd > puts a[0] # Feb 23rd

[Rails] Re: error_messages_for question..

2008-10-19 Thread Craig Demyanovich
Instead of <%= error_messages_for 'customer' %> which is telling error_messages_for to display errors for the string 'customer', which I don't expect to ever work, you should probably use <%= error_messages_for @customer %> assuming that your controller action sets @customer for use by the view

[Rails] nilesh invites you to join Zorpia

2008-10-19 Thread nilesh
Hi rubyonrails-talk! Your friend nilesh from , just invited you to his online photo albums and journals at Zorpia.com. So what is Zorpia? It is an online community that allows you to upload unlimited amount of photos, write journals and make friends. We also have a variety of skins in

[Rails] Re: Preferred adapter for PostgreSQL 8.3 on Rails 2.0.2

2008-10-19 Thread Phillip Koebbe
Fernando Perez wrote: > My bad, the gem postgres is no longer maintained since 2006. > > I am now running with ruby-pg which was last updated on 14th October > 2008. Heh. I was just going to mention ruby-pg. I believe that's the "right" one now. Peace. -- Posted via http://www.ruby-forum.com

[Rails] Re: Why PostgreSQL doesn´t appear on the pro je ct?

2008-10-19 Thread Phillip Koebbe
@c_h Why do you call MySQL a "fake DBMS"? @Fernando I spent a number of years working on SQL Server and when I started working with PGSQL, I found that many of the things I took for granted in SQL Server I had to do differently in PGSQL. I attribute that to Microsoft's fondness of circumvent

[Rails] Re: Preferred adapter for PostgreSQL 8.3 on Rails 2.0.2

2008-10-19 Thread Fernando Perez
My bad, the gem postgres is no longer maintained since 2006. I am now running with ruby-pg which was last updated on 14th October 2008. -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Go

[Rails] Re: Does anybody out there use Litespeed?

2008-10-19 Thread Phillip Koebbe
[EMAIL PROTECTED] wrote: > I've heard good things about Litespeed but all the documentation I've > found doesn't reflect the new 3.3 version. The older 2 and 1 versions > are just so different. I've gone down the road with the old docs and > it's always a dead end. > I'd be happy to pay or trade c

[Rails] Re: Preferred adapter for PostgreSQL 8.3 on Rails 2.0.2

2008-10-19 Thread Fernando Perez
Brian Adkins wrote: > What is the preferred Active Record adapter for PostgreSQL 8.3 on > Rails 2.0.2 ? > > Brian Adkins The post is old, but as of today I installed the gem postgres and specified the adapter postgresql in database.yml everything is running smoothly with Rails 2.1.1 If someon

[Rails] Re: PostgreSQL gem for Ruby (pg) problem!

2008-10-19 Thread Fernando Perez
Hi, That's how I installed the postgres gem on my Mac: sugo gem install postgres -- --with-pgsql-dir=/Library/PostgreSQL/8.3 Then in database.yml, specify the postgresql adapter. Everything works perfectly on my side with PostgreSQL 8.3.4 binary package. -- Posted via http://www.ruby-forum.c

[Rails] Re: Why PostgreSQL doesn´t appear on the pro je ct?

2008-10-19 Thread Fernando Perez
c_h wrote: > Why only MySQL ("fake DBMS") receive a massive support and tutorial. Because it is also widely used by former php developpers. I have just jumped in the PostgreSQL wagon, and I'll try to help guys out. One gotcha I am facing is that some of my SQL queries with JOIN have to be rew

[Rails] error_messages_for question..

2008-10-19 Thread Jay Pangmi
Hi I got a question about error_messages_for helper method in rails. I read that keeping it in the view helps report validation failure. I have used as follows in checkout.rhtml: checkout.rhtml: <%=error_messages_for 'customer'%> <%form_for :customer .%> <%end%> customer.rb:

[Rails] Re: how to do unit test whic allows null in the column

2008-10-19 Thread Jay Pangmi
> I hope this helps. > > RobL Thanks RobL. It sure did help.. -- 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 ema

[Rails] Re: "www" redirection

2008-10-19 Thread Xavier Noria
On Sat, Oct 18, 2008 at 7:02 PM, John Clancy <[EMAIL PROTECTED]> wrote: > I'm thinking a helper called: > def link_to_without_www(options, html_options={}) >[some really awesome code here] > end link_to, image_tag, etc, generate absolute paths without host by default. That is "/products/32

[Rails] Re: map.root doesn't run controller logic?

2008-10-19 Thread Christian Johansen
mahmoud said wrote: > I find this very strange actually... > > what version of rails u r on?? 2.1 > > what happens if u just specified the controller in the mapping (with no > action at all).. the index is the default action anyway.. That also works. Guess we all learned somthing new then :)

[Rails] Re: "www" redirection

2008-10-19 Thread MatthewRudy
On Oct 18, 6:42 pm, Frederick Cheung <[EMAIL PROTECTED]> wrote: > > Have a look at the options that url_for takes > > Fred > you're right fred. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" gr

[Rails] Re: "www" redirection

2008-10-19 Thread MatthewRudy
:host => request.host.sub("www.", "") may do what you want. On Oct 18, 6:42 pm, Frederick Cheung <[EMAIL PROTECTED]> wrote: > On 18 Oct 2008, at 18:02, John Clancy <[EMAIL PROTECTED] > > s.net> wrote: > > > So, I am nearly certain that Alex's original solution will work but   > > if I > > wanted

[Rails] How to pass controller instances class to UserNotifier

2008-10-19 Thread John5511 John5511
Hi, I am using "UserNotifier < ActionMailer::Base" in model. In my User Model class I have these after_create {|user| UserNotifier.deliver_signup_notification(user) } after_save {|user| UserNotifier.deliver_activation(user) if user.recently_activated? } In my view "signup_invitation.rhtml

[Rails] Re: Searching parent objects and associated objects with one search

2008-10-19 Thread Yogi
Thanks for Mark for the 'tuning'. Now that I think of this, can I add another associated table (reviews) and include that into the search also? What I mean is that if the models are Person has_many :readings has_many :books, :through => :readings has_many :reviews

[Rails] Re: how to do unit test whic allows null in the column

2008-10-19 Thread Rob Lacey
Hi Jay, I quite like this way of working its nice and clean and each test demonstrates exactly what you expect to be invalid and why def setup @va.lid_attributes = { :parents => 1 :children => 1, :family_clam => 1, :campsite => 'blah', :total => 100, } end def test_vali

[Rails] how to do unit test whic allows null in the column

2008-10-19 Thread Jay Pangmi
Hi, I have a carts table with columns: campsite, arrival_date, nights, parents, children, family_claim, total. Here children and family_claim column allows null so even if the value is not passed for these columns it should be valid entry. How can I achieve this. At the moment I'm using this way i

[Rails] Re: map.root doesn't run controller logic?

2008-10-19 Thread mahmoud said
I find this very strange actually... what version of rails u r on?? what happens if u just specified the controller in the mapping (with no action at all).. the index is the default action anyway.. try map.root :controller => "events" On Sun, Oct 19, 2008 at 1:14 AM, Christian Johansen < [EMA