Re: [Rails] validates_presence_of problem

2011-01-20 Thread Colin Law
On 19 January 2011 23:58, abdelkrim fitouri abdou@gmail.com wrote: hello every body ! i have a little problem i have created a scaffold Zone witch contain : name , interface and description as attribute all works fine but when i add this line to my model : class Zone

Re: [Rails] Re: How to copy views from development db to test db while running rake ?

2011-01-20 Thread Karthik Bhat
@ Marnen Laibow-Koser Thanks Marnen for the reply. I will look into it and will let you know. Thanks , karthik On Thu, Jan 20, 2011 at 10:27 AM, Marnen Laibow-Koser li...@ruby-forum.comwrote: Karthik l Bhat wrote in post #976157: Hi guys , I am stuck at a particular situation . When I run

[Rails] Re: How to communicate with salesforce

2011-01-20 Thread Sem Ptiri
Kunjan Batavia wrote in post #976176: Hi, I would like to know that how to communicate using ROR with salesforce. I would suggest you start by reading through http://www.salesforce.com/us/developer/docs/api/index.htm For that I have setup ROR on my local system and while executing command:

[Rails] Re: undefined method `call' for nil:NilClass

2011-01-20 Thread Jed Seculles
The cause of this error is on this line: else render :action = location end It should be: else format.html {render :action = 'location'} end When using respond_to, the format of the response is required for any render or redirect_to methods. :) -- Posted

[Rails] Re: How to copy views from development db to test db while running rake ?

2011-01-20 Thread Karthik l Bhat
There is one possible solution which can be done. That is write a script that creates the views and keep it in your fixtures folder .Later call this particular file in the corresponding test files . `bash #{RAILS_ROOT}/test/fixtures/YOURFILENAME.sh

[Rails] RSpec / Cucumber painfully slow Rails 3 OSX

2011-01-20 Thread adam
I am working on my first Rails BDD project with extensive tests since starting out with Rails a few years ago. Running RSpec or Cucumber is really slow. I'm using Rails 3 and RSpec 2. To run one model spec with only 5 tests takes almost 1 minute! When it finishes it says it took only 0.9 seconds

[Rails] Re: RSpec / Cucumber painfully slow Rails 3 OSX

2011-01-20 Thread adam
Ok - please excuse me - it seems that the info on the Spork readme is out of date... the Rails 3 branch has been merged. just installed and ran a test... wow... 1 minute had become 1 second!! :) On Jan 20, 1:06 pm, adam adam.elemen...@gmail.com wrote: I am working on my first Rails BDD project

[Rails] Re: How to communicate with salesforce

2011-01-20 Thread steveb
Kunjan, There are several RoR resources at salesforce.com's developer site, developer.force.com. A great link to start is: http://wiki.developerforce.com/index.php/Getting_Started_with_the_Force.com_Toolkit_for_Ruby The toolkit makes it easy for RoR developers to work with

[Rails] Comment.all returns array of what?

2011-01-20 Thread bourne
I have a bad feeling asking this but I did not manage to find an answer myself :/ @comments = Comment.all @comments is an array. I can for example access comment.created_at directly, or I could do: % @comments.each do |comment| % %= debug comment[created_at] % % end % I expected comment to

[Rails] Re: Comment.all returns array of what?

2011-01-20 Thread Marnen Laibow-Koser
bourne wrote in post #976264: I have a bad feeling asking this but I did not manage to find an answer myself :/ @comments = Comment.all @comments is an array. I can for example access comment.created_at directly, or I could do: % @comments.each do |comment| % %= debug

[Rails] Re: Factory Girl and attr_accessor with validation

2011-01-20 Thread adam
Thank you ! that was the problem... :) On Jan 19, 3:57 pm, Luke Cowell lcow...@gmail.com wrote: OK, I think I have the answer. The docs say:http://api.rubyonrails.org/classes/ActiveModel/Validations/HelperMeth... ... The default value is a string “1”, which makes it easy to relate to an

Re: [Rails] Comment.all returns array of what?

2011-01-20 Thread Jatin kumar
On Thu, Jan 20, 2011 at 2:04 PM, bourne bour...@gmail.com wrote: I have a bad feeling asking this but I did not manage to find an answer myself :/ @comments = Comment.all @comments is an array. I can for example access comment.created_at directly, or I could do: % @comments.each do

[Rails] Re: Comment.all returns array of what?

2011-01-20 Thread bourne
Thanks Marnen for the pointer to the attributes method! For the archives: % @comments.each do |comment| % % comment.attributes.each_pair do |key, value| % %= key %: %= value %br / % end % % end % -- You received this message because you are subscribed to the Google Groups Ruby

[Rails] Re: ActiveRecord Select

2011-01-20 Thread James Byrne
Frederick Cheung wrote in post #975887: foo(:bar) is basically short hand for foo {|f| f.bar}. You'll probably get more google hits by searching for Sym to_proc Fred Thanks. I indeed did have more success with 'Sym to proc'. Of course the bar was set rather low given I found nothing the

[Rails] Re: How to communicate with salesforce

2011-01-20 Thread Shimon Amit
I'd take a look at dm-salesforce-adapter: https://github.com/cloudcrowd/dm-salesforce-adapter I haven't used it, but it has been around for awhile. Shimon -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email

[Rails] [HAML + RAILS 3] cannot output the html from my view helper... just output a string

2011-01-20 Thread Erwin
I am stuck for hours with a view helper I cannot make it running well . In my haml view I wrote %h3= I18n.t(:category_list) #category-list = list_all_categories(@categories) and my helper just output all the html code as a STRING def

[Rails] Re: ActiveRecord Select

2011-01-20 Thread Jim Burgess
James Byrne wrote in post #975885: Could you explain the ':' idiom to me? I cannot seem to find any examples of it by googling. These two posts were helpful for me: http://jlaine.net/2008/5/8/amp-lified http://swaggadocio.com/post/287689063 P.S. The example JLaine uses to illustrate implicit

[Rails] Wrong information

2011-01-20 Thread Noel F.
Hi, I have stumbled across an issue using ruby, I want to put 105°C into a text box using ruby however instead of that it is inputting 105 °C. Can anybody explain a way around this problem? Cheers, Noel -- Posted via http://www.ruby-forum.com/. -- You received this message because you are

Re: [Rails] [HAML + RAILS 3] cannot output the html from my view helper... just output a string

2011-01-20 Thread Colin Law
On 20 January 2011 14:40, Erwin yves_duf...@mac.com wrote:  I am stuck for hours with a view helper I cannot make it running well . In my haml view I wrote        %h3= I18n.t(:category_list)        #category-list                = list_all_categories(@categories) and my helper just

[Rails] Re: RSpec / Cucumber painfully slow Rails 3 OSX

2011-01-20 Thread Robert Walker
adam wrote in post #976260: Ok - please excuse me - it seems that the info on the Spork readme is out of date... the Rails 3 branch has been merged. just installed and ran a test... wow... 1 minute had become 1 second!! If you haven't already done so, you might also take a look at the

[Rails] Rails 3 reload! broken - potential fixes?

2011-01-20 Thread Rabbit on Rails
Crossposted from http://stackoverflow.com/questions/4736546/rails-3-osx-speed-up-console-loading-time In Rails 3.03 the reload! method in the console seems to be broken. If your app gets large, this becomes annoying because you have to wait for the console to load a lot. There are solutions

[Rails] Re: a few best practices questions

2011-01-20 Thread ppgeng...@prevailhs.com
It seems from the rest of the etiquette on this forum I'm supposed to tell you here to top-quote when replying ;p On Jan 19, 7:05 pm, Mike C snib...@gmail.com wrote: Thanks for the link to the nested resource thing, it was an interesting read. So I take it that it's a good idea to define both a

Re: [Rails] Wrong information

2011-01-20 Thread Peter De Berdt
On 20 Jan 2011, at 15:55, Noel F. wrote: I have stumbled across an issue using ruby, I want to put 105°C into a text box using ruby however instead of that it is inputting 105 °C. Can anybody explain a way around this problem? Get your encodings straight. Your browser is displaying UTF-8

[Rails] Re: a few best practices questions

2011-01-20 Thread ppgeng...@prevailhs.com
On Jan 20, 9:58 am, ppgeng...@prevailhs.com ppgeng...@gmail.com wrote: It depends on the resource and how you want to access it, but I generally do. I didn't see it mentioned in here, but if you don't use something like make_resourceful or inherited_resource you should consider it to DRY up

[Rails] Re: Wrong information

2011-01-20 Thread Noel F.
Hi Peter, Thanks for the help, so is it a problem in the browser or problem with ruby? I can manually type 105°C and it works fine. Regards, Noel -- 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: [HAML + RAILS 3] cannot output the html from my view helper... just output a string

2011-01-20 Thread Erwin
thanks, i'll test it = Haml::Engine.new(list_all_categories(@categories)).render(self) in the view seems to render correctly ... On 20 jan, 16:03, Colin Law clan...@googlemail.com wrote: On 20 January 2011 14:40, Erwin yves_duf...@mac.com wrote:  I am stuck for hours with a view

[Rails] Re: a few best practices questions

2011-01-20 Thread Marnen Laibow-Koser
ppgeng...@prevailhs.com wrote in post #976295: It seems from the rest of the etiquette on this forum I'm supposed to tell you here to top-quote when replying ;p On Jan 19, 7:05pm, Mike C snib...@gmail.com wrote: Thanks for the link to the nested resource thing, it was an interesting read. So

[Rails] Re: Wrong information

2011-01-20 Thread Marnen Laibow-Koser
Please quote when replying. Noel F. wrote in post #976306: Hi Peter, Thanks for the help, so is it a problem in the browser or problem with ruby? Neither exactly; on the evidence, it's probably a problem with the programmer. :) Did you set your encoding header to UTF-8 as Peter suggested?

[Rails] Re: Comment.all returns array of what?

2011-01-20 Thread Marnen Laibow-Koser
Please quote when replying. bourne wrote in post #976269: Thanks Marnen for the pointer to the attributes method! For the archives: % @comments.each do |comment| % % comment.attributes.each_pair do |key, value| % %= key %: %= value %br / % end % % end % You're welcome!

[Rails] Re: distance_of_time_in_words shows {{count}} days instead of showing actual days

2011-01-20 Thread Jonathan Rochkind
Colin Law wrote in post #968871: On 15 December 2010 19:07, Amit Ambardekar amit...@gmail.com wrote: Time to show next topic {{count}} days Are you using internationalisation? If so then it could be an issue there. Google for time to show in words rails count produced some possibilities

[Rails] PUT request via HTTPS not handled properly

2011-01-20 Thread 24z
I've started to create a very basic rails app. It basically outputs the body of an incoming HTTP PUT request to the console. Unfortunately, it only handles HTTP requests and completely ignores HTTPS requests. Do I have anything special to my Rails 3 routes.rb. It currently looks like this:

[Rails] Re: distance_of_time_in_words shows {{count}} days instead of showing actual days

2011-01-20 Thread Marnen Laibow-Koser
Jonathan Rochkind wrote in post #976328: Colin Law wrote in post #968871: On 15 December 2010 19:07, Amit Ambardekar amit...@gmail.com wrote: Time to show next topic {{count}} days Are you using internationalisation? If so then it could be an issue there. Google for time to show in words

Re: [Rails] Re: distance_of_time_in_words shows {{count}} days instead of showing actual days

2011-01-20 Thread Walter Lee Davis
On Jan 20, 2011, at 1:19 PM, Marnen Laibow-Koser wrote: 2.3.10 fixes all bugs and security holes AFAIK -- and there *are* security holes, so you really should give it a try. I found the differences between 2.3.5 and 2.3.10 fairly minor, but my apps are all pretty small. Mostly it had to do

[Rails] Re: establish_connection only on need

2011-01-20 Thread ivanpoval
Are you doing something like this ?: class YourModel ActiveRecord::Base establish_connection :db_config end On Jan 19, 4:19 am, Vitaliy Yanchuk li...@ruby-forum.com wrote: I have one abstract ActiveRecord::Base class that establishes connection to other db, and it does every time it is

[Rails] Re: establish_connection only on need

2011-01-20 Thread Vitaliy Yanchuk
Yes -- 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

[Rails] where does 'bundle install' store executables?

2011-01-20 Thread Fearless Fool
This should be an easy one: where does 'bundle install' store executables, e.g. rspec and annotate? I ask because, in my case, the executables are getting written to: ${DEVROOT}/usr/lib/ruby/gems/1.9.1/bin/ rather than (what I'd expect): ${DEVROOT}/usr/bin/ (In my case, DEVROOT is a

[Rails] Re: PUT request via HTTPS not handled properly

2011-01-20 Thread Robert Walker
24z wrote in post #976330: Do I have anything special to my Rails 3 routes.rb. It currently looks like this: PutTest::Application.routes.draw do controller :put_test do match 'put', :to = :update, :via = [:put] end end Unless my understanding of the Rails 3 routing syntax is

[Rails] Re: PUT request via HTTPS not handled properly

2011-01-20 Thread jgwmaxwell
Yeah, the original syntax makes no sense unfortunately. If you do want to invoke per controller routing, it needs to be through: resources :controllername do ## do stuff end -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this

[Rails] Re: Can't install mongrel with ruby 1.9.2p136

2011-01-20 Thread Douglas Fonseca
Thanks! I'll migrate to Linux and try it there! Regards On Jan 17, 3:41 pm, Robert Walker li...@ruby-forum.com wrote: Douglas Fonseca wrote in post #975480: I'm getting this error message when I try to install Mongrel with gem install mongrel on Windows 7 x64 gem install mongrel

[Rails] NoMethodError

2011-01-20 Thread Simon M.
Hi,any ideas how to fix this error, im trying to create a users login.register. which i have called users1. Here is the error message i9n my view.Thanks NoMethodError in User1#index Showing app/views/user1/index.html.erb where line #6 raised: You have a nil object when you didn't expect it! You

[Rails] Re: Can't install mongrel with ruby 1.9.2p136

2011-01-20 Thread Marnen Laibow-Koser
Robert Walker wrote in post #975494: Douglas Fonseca wrote in post #975480: I'm getting this error message when I try to install Mongrel with gem install mongrel on Windows 7 x64 gem install mongrel Successfully installed mongrel-1.1.5-x86-mingw32 1 gem installed Installing ri

[Rails] Re: Can't install mongrel with ruby 1.9.2p136

2011-01-20 Thread Robert Walker
Marnen Laibow-Koser wrote in post #976394: Interesting. I had rails s work out of the box on a new Ruby 1.9.2/Rails 3 installation (granted, this was on Mac OS, not Windows). I'd use Passenger if Mongrel and Thin didn't work, but I still see little point in bothering with it for development

[Rails] Re: Newbie Help: Agile Rails book's Hello World

2011-01-20 Thread Barry O'gorman
Wyatt R. wrote in post #949730: If using Rails 3.0 then before restarting server with rails server edit config/routes.rb, and uncomment the following line: match ':controller(/:action(/:id(.:format)))' then restart server THIS WAS AMAZING. THANK YOU SO MUCH. Why does no one say anything

[Rails] Re: NoMethodError

2011-01-20 Thread djangst
How about trying 'User1.find(:all)' in the console ('rails console')? Or use the debugger and step into the index method to see if/where @users isn't being populated. On Jan 20, 5:40 pm, Simon M. li...@ruby-forum.com wrote: NoMethodError in User1#index Showing app/views/user1/index.html.erb

[Rails] Re: Can't install mongrel with ruby 1.9.2p136

2011-01-20 Thread Marnen Laibow-Koser
Robert Walker wrote in post #976399: Marnen Laibow-Koser wrote in post #976394: Interesting. I had rails s work out of the box on a new Ruby 1.9.2/Rails 3 installation (granted, this was on Mac OS, not Windows). I'd use Passenger if Mongrel and Thin didn't work, but I still see little point

[Rails] Re: NoMethodError

2011-01-20 Thread Marnen Laibow-Koser
Simon M. wrote in post #976391: Hi,any ideas how to fix this error, im trying to create a customer login/register page. which i have called users1. Off topic, but...why call them users1? If they're customers, just call them that. Keep your names meaningful. Best, --  Marnen Laibow-Koser

[Rails] [Belgium] Rails Hackathon

2011-01-20 Thread jvandenbroeck
Anyone interested in joining a ruby on rails hackathon @belgium from friday evening, 11 februari until sunday evening 2 days and 2 nights to create _awesome_ Rails application, I'll organize it @leuven if there's interest :-) email or reply here^ -- You received this message because you are

[Rails] what's up with rails

2011-01-20 Thread Mage
Hello, I subscribed a long time ago but had no time to read the list. I was just wondering what's up with rails? The website and the blog wasn't updated since November (except the news aobut a conference). What is happening? Maybe I am just too anxious. Mage -- You

[Rails] Re: RSpec / Cucumber painfully slow Rails 3 OSX

2011-01-20 Thread Arailsdemo A.
1) If your running 'rake spec', then don't, unless you need to do 'rake db:test:prepare' also. The 'rake spec' command combines the database rake with 'rspec spec', that's why it takes a few seconds before the tests are run. Use 'rspec spec' instead. 2) Use Spork and Autotest. Follow

[Rails] Regex, size check inside a Controller's method.

2011-01-20 Thread CuriousNewbie
Hello, I'm working to create a method in my controller to check an email to see if the email's domain is acceptable. I want to prevent gmail and hotmail for certain reasons. Here's what I have so far: controller: if valid_email_domain(email_address) # good email domain else #