[Rails] Re: Oniguruma and Ultraviolet on Windows 7

2010-03-14 Thread Sunny Hirai
Hi amacgregor, Any help would be greatly appreciated. Could you explain to me, perhaps with some detail, how you got the gem install oniguruma --platform--mingw32 to work? I installed the devkit for Ruby 19 on Windows. I've used it to successfully to get the RMagick gem working on 1.9 so it

[Rails] Upgrading rails, ruby and gems

2010-03-14 Thread Yudi Soesanto
Hi guys, Is there any good documentation to upgrade rails, ruby and supported gems? I use mac tiger. Also, what is the stable version of ruby? Thanks, ys -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email

Re: [Rails] How can I conditional the validation on a model validation?

2010-03-14 Thread Anthony Gardner
If you're asking how do I avoid the validation check on name and id when updating, then you should look at :on = params for validation. validates_presence_of :id, :name, :on = :create I think everything is clearly explained in the docs.

Re: [Rails] validates_presence_of :parent_id stopping save

2010-03-14 Thread Anthony Gardner
Hi, I'm not sure 100% what you're trying to do but the presence of question_id will not be there until the record has been saved. No? And I'm not sure why you're doing this @grading = @question.gradings.build(more_attributes) Shouldn't you have done a build before presenting your form if

[Rails] unit testing and activerecord (mis)behavior

2010-03-14 Thread Rajinder Yadav
In my active record model I have declared a 'before_save' callback, that populates other fields before saving the data. However I am finding all my unit test cases are breaking because it seems the 'before_save' callback is not getting called during a unit test run? In fact I have to provide

Re: [Rails] unit testing and activerecord (mis)behavior

2010-03-14 Thread Colin Law
On 14 March 2010 12:08, Rajinder Yadav devguy...@gmail.com wrote: In my active record model I have declared a 'before_save' callback, that populates other fields before saving the data. However I am finding all my unit test cases are breaking because it seems the 'before_save' callback is not

Re: [Rails] validates_presence_of :parent_id stopping save

2010-03-14 Thread Rob Lacey
I'd say the best way to deal with this is never validate for a association_id #validates_presence_of :question_id validates_presence_of :question would be better. if grading.question_id is nil then grading.question will also be nil. So you're effectively doing the same check. I hope this helps

[Rails] Re: install rails3 --pre on snow leopard w ruby 1.8.7 -- memcache_client gem problems

2010-03-14 Thread Ray Krueger
Following the indications listed here:http://weblog.rubyonrails.org/2010/2/5/rails-3-0-beta-release/ in other words:  sudo gem install tzinfo buildermemcache-clientrack rack-test rack- mount erubis mail text-format thor bundler i18n  sudo gem install rails --pre The first line installed

[Rails] Re: unit testing and activerecord (mis)behavior

2010-03-14 Thread Rajinder Yadav
Rajinder Yadav wrote: In my active record model I have declared a 'before_save' callback, that populates other fields before saving the data. However I am finding all my unit test cases are breaking because it seems the 'before_save' callback is not getting called during a unit test run? In

[Rails] Linkedin plugin

2010-03-14 Thread soesanty
Is there any plugins to connect to linkedin? If not, do you have a sample rails code to connect to linkedin? the goal I want to be able to update linkedin share ideas, articles, quotes, and more through my application. Any thought? Yudi Sent from my AXIS Worry Free BlackBerry® smartphone --

[Rails] RESTful route question

2010-03-14 Thread Dudebot
I have in routes.rb map.resources :labs, :collection = { :group = :get } which is working. But when I try to pass a parameter, e.g. % form_tag group_labs_path( :patient_id = @patient.id ), :method = :get do % The :patient_id isn't getting passed to the controller: ---

Re: [Rails] Noob: database selection question

2010-03-14 Thread Hassan Schroeder
On Fri, Mar 12, 2010 at 8:40 PM, Len Sumnler li...@ruby-forum.com wrote: The book seems to suggest that development should be done using sqlite3 and that the testing and/or production can be switched to some other database.  Now it does not say you have to do it this way and even gives

[Rails] Re: install rails3 --pre on snow leopard w ruby 1.8.7 -- memcache_client gem problems

2010-03-14 Thread benissimo
No this was regular (not j-) ruby, 1.8.7. I think my problem was related to rubygems, at the time I still had 1.3.5. Later I installed rvm and, again using ruby 1.8.7, I had more luck doing a fresh start by first updating rubygems to 1.3.6 and then running only gem install rails --pre, which

[Rails] Re: validates_presence_of :parent_id stopping save

2010-03-14 Thread Max Williams
Rob Lacey wrote: I'd say the best way to deal with this is never validate for a association_id #validates_presence_of :question_id validates_presence_of :question would be better. Hi Rob! I played with this already, and got a surprising result: @question = Question.new(attributes) =a

[Rails] Re: validates_presence_of :parent_id stopping save

2010-03-14 Thread Max Williams
Hi Anthony, thanks. I'm not using the rails-supplied nested attributes methods here, though maybe i should. I'm effectively hand-rolling my own, so i create a question and some associated objects (eg a grading in this case) at the same time, from a single form. When i drop the validation on

[Rails] Integrating beast in existing rails app (database conflict).

2010-03-14 Thread rick_2047
Hi, I want to integrate the beast forums in an existing rails app, but there is a database conflict. I already have a post model for the blog and beast requires it. How do I eliminate the problem. Regards, Paresh -- You received this message because you are subscribed to the Google Groups Ruby

[Rails] Re: Linkedin plugin

2010-03-14 Thread Josiah Ivey
There is the Linkedin gem by Wynn Netherland: http://github.com/pengwynn/linkedin On Mar 14, 9:52 am, soesa...@gmail.com wrote: Is there any plugins to connect to linkedin? If not, do you have a sample rails code to connect to linkedin? the goal I want to be able to update linkedin share

[Rails] determining where a function is called from

2010-03-14 Thread Will Merrell
I have a function that I use in my code in a number of places. It does some database lookup, processes it and returns some content to display. However, it needs to know where it was called from so that it can set up some return links. Currently I call it from a controller like this:

[Rails] Link as a link AND as a function

2010-03-14 Thread Michael Murillo
Hi there, I am relatively new to Rails and I am trying to do a fairly common task. I have a page that displays a series of links that go to offsite URLS. Next to each link is a counter that shows how many times that link has been clicked-through. I would like to be able to have the user click on

[Rails] Re: Problem indexing add Simple Table Inherance

2010-03-14 Thread John Smith
Matt Jones wrote: On Mar 11, 4:50�am, John Smith li...@ruby-forum.com wrote: I have a simple table inherance, with an upper class GeneralElement. A class that inherits is Activity: class Activity GeneralElement ... end The GeneralElement table is very big (about 2.000.000 rows!). Other

[Rails] Re: Coding a migration to change a column's attribute

2010-03-14 Thread RichardOnRails
Hi Frederick, Thanks for taking the time to look at my newbie code. I now have both styles: change_column :expenses, :amount, :decimal, :precision = 10, :scale = 2 # DSL-style change_column( expenses, amount, decimal(10, 2) ) # C-style working. Thank you

[Rails] Re: Coding a migration to change a column's attribute

2010-03-14 Thread RichardOnRails
Hi Craig, As I mentioned to Frederick, I've got both the DSL-style and C-Style for change_column working after a bunch of stumbles. I expect to be much better with future migrations I code. In that context, I'm sure the --trace option you pointed out will be very helpful. Thanks for taking

Re: [Rails] Link as a link AND as a function

2010-03-14 Thread Jeffrey L. Taylor
Quoting Michael Murillo li...@ruby-forum.com: Hi there, I am relatively new to Rails and I am trying to do a fairly common task. I have a page that displays a series of links that go to offsite URLS. Next to each link is a counter that shows how many times that link has been

Re: [Rails] newbie seek for help about paperclippolymorph

2010-03-14 Thread Xianggong
thank you Christophe, it's really helpful, and it works for me. -- 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-t...@googlegroups.com. To unsubscribe from this group, send email to

Re: [Rails] Re: Linkedin plugin

2010-03-14 Thread Yudi Soesanto
Thank for your help. Yudi Soesanto On Sun, Mar 14, 2010 at 11:53 AM, Josiah Ivey josiah.i...@gmail.com wrote: There is the Linkedin gem by Wynn Netherland: http://github.com/pengwynn/linkedin On Mar 14, 9:52 am, soesa...@gmail.com wrote: Is there any plugins to connect to linkedin? If

[Rails] Error running mysql in ror

2010-03-14 Thread Yudi Soesanto
I just upgraded rails 2.3.5 and I got the error when I tried to run my application. Here few information: - My OS Mac Tiger - Rails version 2.3.5 - Ruby version ruby 1.8.6 - gem version 1.3.6 - I run command: which rails /usr/local/bin/rails - I run command: which ruby /usr/local/bin/ruby

[Rails] Undefined method when creating a has_many relationship

2010-03-14 Thread MarkB
My first attempt at working with a new has_many relationship is throwing an error in the view when I try to create a new 'rcost' instance linked to a 'resource' (each resource can have multiple costs): undefined method `rcosts_path' for #ActionView::Base:0x715bc60 Here is the view (new.html.erb)