[Rails] Re: Weird gsub behaviour

2010-02-19 Thread stevo84
No, I did not... and it sure works! I knew that it should be easier :) Thank You for another piece of knowledge, Rob and Xavier On 19 Lut, 16:08, Rob Biedenharn wrote: > On Feb 19, 2010, at 5:14 AM, stevo84 wrote: > > > The exact problem > > > a = '' > > b = ' > onclick="add_fields(this, "invoic

[Rails] Re: Problem with file_field

2010-02-19 Thread senling
Try this. #form <%form_tag({:action => 'upload_file'},:id=>@student.id,:multipart => true) do-%> <%= file_field :upload, :datafile%> <%= submit_tag "Upload" %> <%end%> #method def upload_file data = params[:upload] orig_fileName = data[:datafile].original_filename filePath = "#{RAILS_RO

[Rails] searching based on the return values of instance methods

2010-02-19 Thread Ease Bus
Can I use something like searchlogic to search for objects based on the return values of instance methods? E.g., I'd like to search for users of a certain "age" but age is not a column, it's an instance method, returning the age value calculated from the birthdate, which is a column. Is there a q

[Rails] Script/server reference wrong version of initializer.rb

2010-02-19 Thread RichardOnRails
Hi All, In my Rails app RTS, I specify: RAILS_GEM_VERSION = '2.3.5' in \RTS\config\environment.rb I have no Windows environment variable named RAILS_GEM_VERSION When I run ruby script/server, I get the error message: K:/_Utilities/ruby186-26_rc2/ruby/lib/ruby/gems/1.8/gems/rails-1.2.3/ lib/ini

[Rails] Re: What's the latest reliable version of Rails 2?

2010-02-19 Thread RichardOnRails
High Steve, Because this topic only garnered one response today, I'm, going to post the remaining question as a new topic. Again, thanks for addressing the first question. -- Richard On Feb 19, 9:45 pm, RichardOnRails wrote: > Hi Steve, > > Thanks for your response. > > I solved one of my probl

[Rails] Re: What's the latest reliable version of Rails 2?

2010-02-19 Thread RichardOnRails
Hi Steve, Thanks for your response. I solved one of my problems: the "rack(1.0.0 not ~> 1.0.1)" error: following the advice on another forum, I executed: gem install rack -v 1.0.1 That leaves another problem: I'm running "ruby script/server" in the directory, RTS containing a Rails implementati

[Rails] Re: First time rails install, help with gems/rake

2010-02-19 Thread Matt Jones
On Feb 19, 3:45 pm, danwoods wrote: > Hello all, >     I just did a first time ruby enterprise edition, installed some gems, > and now I'm trying to do a ' sudo ./rake gems:install' and getting a: > rake aborted!                             > No Rakefile found > > error. Firstly, what directory

[Rails] update user input to another table without using html form

2010-02-19 Thread John Merlino
Hey all, Let's say you are not going to use an html form. Rather the user will input data in a third-party application that will communicate with the rails controller through http requests, but serves as a replacement to the html. In other words, it's taking the place of front end. My question is

[Rails] formhelper password_field only takes two arguments

2010-02-19 Thread Ralph Shnelvar
When I look at the docs, password_field seems to take 3 arguments. So when I 'play around" with things and I attempt to pass three arguments to password_field ... I get an error saying that it only takes two parameters ("3 for 2") I am totally lost. -- Posted via http://www.ruby-forum.com/. --

[Rails] Re: Error: undefined method for nil:NilClass

2010-02-19 Thread Jeff King
OK, I figured it out. I just needed to populate my fixtures (in /tests/fixtures/). There is a good videocast addressing how to represent these relationships here: http://railscasts.com/episodes/81-fixtures-in-rails-2-0 -- Posted via http://www.ruby-forum.com/. -- You received this message be

[Rails] Debugger stopped working

2010-02-19 Thread acreadinglist
script/server --debug and script/server --debugger lead to an error. Despite just uninstalling and reinstalling rails and ruby-debug. It worked 3 days ago. >>:~/Workspace/my_app$ sudo gem1.8 install rails Successfully installed rails-2.3.5 1 gem installed Installing ri documentation for rails-2.3

[Rails] Re: Error: undefined method for nil:NilClass

2010-02-19 Thread Jeff King
and of course, the source code is not escaped... -- 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-t...@googlegroups.com. To unsubscribe from this g

[Rails] Error: undefined method for nil:NilClass

2010-02-19 Thread Jeff King
When I test functionals, I get the following error: test_should_display_index(AlertsControllerTest): ActionView::TemplateError: undefined method `name' for nil:NilClass On line #9 of app/views/alerts/index.html.erb 6: 7: 8:

Re: [Rails] What's the latest reliable version of Rails 2?

2010-02-19 Thread Steve Klabnik
You'd have been fine with 2.3.5 if you'd have rack 1.0.1 installed. -- 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 rub

[Rails] What's the latest reliable version of Rails 2?

2010-02-19 Thread RichardOnRails
Hi, I just installed Rails 2.3.5 over Ruby 1.8.6 When I try to bring up Webrick now, I get: K:/_Utilities/ruby186-26_rc2/ruby/lib/ruby/site_ruby/1.8/rubygems.rb: 827:in `report_activate_error': RubyGem version error: rack(1.0.0 not ~> 1.0.1) Gem::LoadError) When I revert to Rails 1.2.3 over Rub

[Rails] Re: noobish: create migration to add foreign keys with :thro

2010-02-19 Thread fearless_fool
@Marnen: first, apologies on the misspelling -- no slight intended. After thrashing around on this forum and working through AWDwR, I can pose my question more succinctly. But bear with me if I still get it wrong... * You use migrations to define / extend / modify the tables in your db. * Activ

[Rails] Re: Can't run script/console on with rails 2.3.5

2010-02-19 Thread Sonny Chee
> I had some trouble with rack versions when transitioning to 2.3.5. > Specifically, I found I could not use Rack 1.1.0 in my setup. I ended > up installing rack 1.0.1 and freezing it in the app - then all my > issues resolved. > > -- > Kurt Werle > I am looking for a new Rails job: > http://www

[Rails] Re: Can't run script/console on with rails 2.3.5

2010-02-19 Thread kwe...@pobox.com
On Feb 19, 9:36 am, Sonny Chee wrote: > >> I've tried updating all of gems to no avail. Any advice would be > >> appreciated. > > Incidentally, I'm already at rack 1.1.0 > > Dave Lynch wrote: > > You need to update to rack 1.0.1 I had some trouble with rack versions when transitioning to 2.3.5.

[Rails] Re: Escaping URL on routes.rb

2010-02-19 Thread Marcos Placona
Works a treat Xavier. Thanks a lot! On Feb 19, 6:09 pm, Xavier Noria wrote: > The dot is a separator. There's a workaround though, add > >     :requirements => {:email => /.*/} > > to the route definition. -- You received this message because you are subscribed to the Google Groups "Ruby on Ra

Re: [Rails] env: ruby1.9: No such file or directory - FIX

2010-02-19 Thread Conrad Taylor
On Fri, Feb 19, 2010 at 2:27 PM, Kristian wrote: > In the root of a rails 3 app: > > $ rails > env: ruby1.9: No such file or directory > $ script/rails > env: ruby1.9: No such file or directory > $ script/rails generate > env: ruby1.9: No such file or directory > $ ruby -v > ruby 1.9.1p378 (2010-

Re: [Rails] Re: Authlogic Rails 3

2010-02-19 Thread Conrad Taylor
On Fri, Feb 19, 2010 at 2:37 PM, Conrad Taylor wrote: > On Fri, Feb 19, 2010 at 12:42 PM, straightfl...@gmail.com < > straightfl...@gmail.com> wrote: > >> I am now getting an error >> irb(main):002:0> u = UserSession.find(1) >> NameError: uninitialized constant AuthLogic >> >> > Try using the fol

Re: [Rails] Re: Authlogic Rails 3

2010-02-19 Thread Conrad Taylor
On Fri, Feb 19, 2010 at 12:42 PM, straightfl...@gmail.com < straightfl...@gmail.com> wrote: > I am now getting an error > irb(main):002:0> u = UserSession.find(1) > NameError: uninitialized constant AuthLogic > > Try using the following line within your Gemfile: gem "authlogic" If that doesn't w

[Rails] env: ruby1.9: No such file or directory - FIX

2010-02-19 Thread Kristian
In the root of a rails 3 app: $ rails env: ruby1.9: No such file or directory $ script/rails env: ruby1.9: No such file or directory $ script/rails generate env: ruby1.9: No such file or directory $ ruby -v ruby 1.9.1p378 (2010-01-10 revision 26273) [i386-darwin10.2.0] $ mate script/rails #!/usr

Re: [Rails] Re: Re: Unable to load file in testing

2010-02-19 Thread Colin Law
On 19 February 2010 19:56, Hemant Bhargava wrote: >> That should be ok then, you said something about using >> set_fixture_class, what have you specified, where, and why? >> What is the name of the test class? >> >> Colin > > No colin .. That is not ok.. thats why i put my question here.. Even i >

[Rails] Adding files for autotest to monitor

2010-02-19 Thread drewB
I am using autotest with RSpec (autospec) and for some reason it doesn't monitor files under the integration folder. Does anyone know how to config autotest to monitor additional paths? I tried playing with add_mapping in my .autotest but was not able to get it to work. Thanks! P.S. I know that

[Rails] Re: Multiple associations with to_json

2010-02-19 Thread Aj Oneal
Multiple json inculded associations without parameters model_name.to_json( :include => [ :assoc_1, :assoc_2 ]) Works Multiple json inculded associations with parameters model_name.to_json( :include => [ {:assoc_1 => params}, {:assoc_2 => params} ]) Fails Multiple jso

[Rails] First time rails install, help with gems/rake

2010-02-19 Thread danwoods
Hello all, I just did a first time ruby enterprise edition, installed some gems, and now I'm trying to do a ' sudo ./rake gems:install' and getting a: rake aborted! No Rakefile found error. Firstly, what directory should I be doing this from? -- View this message

Re: [Rails] Re: Authlogic Rails 3

2010-02-19 Thread straightfl...@gmail.com
I am now getting an error irb(main):002:0> u = UserSession.find(1) NameError: uninitialized constant AuthLogic $ grep authlogic Gemfile gem "authlogic", :git => "git://github.com/binarylogic/authlogic.git" $ bundle check The Gemfile's dependencies are satisfied For some reason bundle pack doesnt

[Rails] You are being redirected

2010-02-19 Thread byrnejb
I have done something to my application controller so that instead of the redirected page itself am now seeing this as a response: You are being http://www.example.com/ welcome">redirected. I do not know why this is happening or what I did to trigger this behaviour. The API does not give me an

[Rails] Re: Re: Unable to load file in testing

2010-02-19 Thread Hemant Bhargava
> That should be ok then, you said something about using > set_fixture_class, what have you specified, where, and why? > What is the name of the test class? > > Colin No colin .. That is not ok.. thats why i put my question here.. Even i am thinking that i am doing all right.. But still .. I hav

Re: [Rails] JOBS $3000 USD REFERRAL FOR RUBY DEVELOPER IN BEIJING TO $120,000 USD

2010-02-19 Thread Craig White
On Fri, 2010-02-19 at 12:45 -0700, Craig White wrote: > On Thu, 2010-02-18 at 12:12 -0800, Kevin Cure wrote: > > I hope all is going well for everyone as we move deeper into 2010. I > > am looking for a referral for a Ruby/ROR developer for a multinational > > startup in Beijing. Can be relocated

Re: [Rails] JOBS $3000 USD REFERRAL FOR RUBY DEVELOPER IN BEIJING TO $120,000 USD

2010-02-19 Thread Craig White
On Thu, 2010-02-18 at 12:12 -0800, Kevin Cure wrote: > I hope all is going well for everyone as we move deeper into 2010. I > am looking for a referral for a Ruby/ROR developer for a multinational > startup in Beijing. Can be relocated from anywhere in the world. I > am paying a $3000 USD referr

[Rails] Re: Cannot install ruby-postgres on Windows

2010-02-19 Thread Sharagoz --
> You have to install development tools firs Hello again. It is trying to install from source instead of binary, which requires a compiler. Try setting the platform to mswin32 and it will hopefully install the binary version. gem install ruby-postgres --platform=mswin32 -- Posted via http://ww

[Rails] Re: Cannot install ruby-postgres on Windows

2010-02-19 Thread Fernando Perez
ruby-postgres is deprecated. Use "pg" 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 group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe from this gro

[Rails] Re: Invalid .gemspec format - multiple gem repos?

2010-02-19 Thread Kristian
Found the bug and solution here: https://rails.lighthouseapp.com/projects/8994/tickets/3865-invalid-gemspec-format-in-and-already-initialized-constant-warnings-with-ruby-192dev -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to t

[Rails] map center/zoom problems in ym4r

2010-02-19 Thread badnaam
I am trying to show a list of events and their locations in a map in my index action. I use will pagination for paginating through the events. The first call to the page is a regular "html" format and the subsequents calls are ajax calls. I initialize the map and markergroup that contains the event

[Rails] Re: undefined method `start_form_tag' for #

2010-02-19 Thread Franky Lucky
While doing a tutorial on tutorialpoint, I had the same problem! I made the change, but I get another error : NoMethodError in Book#new Showing app/views/book/new.rhtml where line #4 raised: undefined method `title' for # Extracted source (around line #4): 1: Add new book 2: <%= form_tag :acti

[Rails] Invalid .gemspec format - multiple gem repos?

2010-02-19 Thread Kristian
kristian-mandrups-macbook-pro:edgier kristianconsult$ rake db:migrate (in /Users/kristianconsult/my_rails/rails3_apps/edgier) WARNING: #' for nil:NilClass> # -*- encoding: utf-8 -*- Gem::Specification.new do |s| s.name = %q{abstract} ... WARNING: Invalid .gemspec format in '/usr/local/Cellar/r

[Rails] Re: Where does rake get its default rakefile?

2010-02-19 Thread Frederick Cheung
On Feb 19, 5:48 pm, Pito Salas wrote: > Philip Hallstrom wrote: > >>> Follow the rabbit down the trail... > >> different places? > > Ah.  Gotcha. > > > The default rails tasks come out of vendor/rails/railties/lib/tasks. > > You're own tasks get picked up out of lib/tasks. > > Plugin tasks come

[Rails] Re: image tag partial refresh

2010-02-19 Thread Guille San
Aldric Giacomoni wrote: > Guille San wrote: >> Hi everyone >> >> I´m doing a web page, and I wanna to show a picture but this picture >> change every 10 minutes. I wanna to show it and refresh t automatically, >> but I want to refresh only the image. How can I do that >> >> Thanks a lot > > Soun

[Rails] Cannot install ruby-postgres on Windows

2010-02-19 Thread Sébastien Clément
My system is Windows Server 2008 SP2 Ruby and gem versions: -- C:\Windows\system32>ruby -v ruby 1.9.1p378 (2010-01-10 revision 26273) [i386-mingw32] C:\Windows\system32>gem -v 1.3.5 When I try to install the ruby-postgres gem, here is what it says: ---

[Rails] Re: image tag partial refresh

2010-02-19 Thread Aldric Giacomoni
Guille San wrote: > Hi everyone > > I´m doing a web page, and I wanna to show a picture but this picture > change every 10 minutes. I wanna to show it and refresh t automatically, > but I want to refresh only the image. How can I do that > > Thanks a lot Sounds like you need to create a DIV with

Re: [Rails] Escaping URL on routes.rb

2010-02-19 Thread Xavier Noria
The dot is a separator. There's a workaround though, add :requirements => {:email => /.*/} to the route definition. -- 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.c

[Rails] Re: Some fundamental architectural insights on the Ruby On

2010-02-19 Thread Robert Walker
Xavier Noria wrote: > On Fri, Feb 19, 2010 at 10:41 AM, Krum Bakalsky > wrote: > >> executing Ruby code ? > In that analogy you can think Mongrel is something similar to Tomcat. > It is a web server, but one that can also serve Rails applications. Another important piece of this puzzle when rel

[Rails] image tag partial refresh

2010-02-19 Thread Guille San
Hi everyone I´m doing a web page, and I wanna to show a picture but this picture change every 10 minutes. I wanna to show it and refresh t automatically, but I want to refresh only the image. How can I do that Thanks a lot -- Posted via http://www.ruby-forum.com/. -- You received this message

[Rails] Re: Re: Where does rake get its default rakefile?

2010-02-19 Thread Pito Salas
Philip Hallstrom wrote: >>> Follow the rabbit down the trail... >> different places? > Ah. Gotcha. > > The default rails tasks come out of vendor/rails/railties/lib/tasks. > You're own tasks get picked up out of lib/tasks. > Plugin tasks come out of vendor/plugins//tasks. > > -philip Philip

[Rails] Re: Can't run script/console on with rails 2.3.5

2010-02-19 Thread Sonny Chee
>> I've tried updating all of gems to no avail. Any advice would be >> appreciated. Incidentally, I'm already at rack 1.1.0 Dave Lynch wrote: > You need to update to rack 1.0.1 > > gem update rack > > to see what version you have > gem list -l -- Posted via http://www.ruby-forum.com/. -- You

[Rails] Rails and decimals problem

2010-02-19 Thread Fernando Perez
Hi, I was working on a plugin to enhance ActiveRecord's models so that it's easy to handle decimal numbers and store them as integers. I was dynamically creating instance methods to output the formatted attribute (145 becomes 14.5) Now there is a problem with Rails forms (for example), as they ac

[Rails] Re: Upgrading the Rails Version Used by an Existing Application

2010-02-19 Thread doug
I have not yet done detailed testing; but, at least superficially, your suggestion seems to have resolved the issue. Thanks very much for the input. ... doug -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group,

[Rails] Future of DRb?

2010-02-19 Thread Marc Byrd
What's the future of DRb in Rails 3.0 world? Is there something else coming along that will be preferable (e.g. ActiveWorker)? Starling/Workling? SimpleWorker? Redis/Resque? Thanks! Marc -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" gro

RE: [Rails] wrong number of arguments (Wrox Beginning Ruby On Rails)

2010-02-19 Thread Pardee, Roy
The scaffold generator takes a model name, followed by an optional space-delimited list of field name:type specs. So you might say: script/generate scaffold Book name:string description:text price:decimal Or you can leave off the list of field names (in which case you don't get much in your

[Rails] Re: Hooking validates

2010-02-19 Thread Ralph Shnelvar
Michael Pavling wrote: > On 19 February 2010 16:14, Ralph Shnelvar wrote: >> I want to hook the validation routines so that I can flag html labels >> and change their color to better indicate which fields need to be >> corrected in a form. >> >> Is there a way to do this conveniently and/or conven

[Rails] Re: Strange production vs. development behavior difference

2010-02-19 Thread pepe
Thanks Fred, that explains it. Thank you very much to all of you for your help. Pepe On Feb 19, 11:28 am, Frederick Cheung wrote: > On Feb 19, 4:17 pm, pepe wrote: > > > > > Xavier, > > > I had thought about that long ago and I was sure I was working with > > the right application. I don't hav

Re: [Rails] Hooking validates

2010-02-19 Thread Michael Pavling
On 19 February 2010 16:14, Ralph Shnelvar wrote: > I want to hook the validation routines so that I can flag html labels > and change their color to better indicate which fields need to be > corrected in a form. > > Is there a way to do this conveniently and/or conventionally? you can interrogate

Re: [Rails] Re: Unable to load file in testing

2010-02-19 Thread Colin Law
On 19 February 2010 16:03, Hemant Bhargava wrote: > Colin Law wrote: >> >> Googling the error message suggests that this means that it cannot >> find the fixtures file.  How have you specified the fixtures in the >> _test.rb file and what is the name of the holidays fixture file? >> > > Thanks for

[Rails] Re: Strange production vs. development behavior difference

2010-02-19 Thread Frederick Cheung
On Feb 19, 4:17 pm, pepe wrote: > Xavier, > > I had thought about that long ago and I was sure I was working with > the right application. I don't have any other application with the > same name anywhere in the system and the changes I was making to the > views for debugging purposes were being

Re: [Rails] Re: HABTM: join table records being deleted & not restored when validation fails

2010-02-19 Thread Michael Pavling
On 19 February 2010 16:19, Ian wrote: > UI wise, that ends up being a bit awkward. The user thinks they've > deselected all learners, but if they edit the page again, all the > learners are still selected. > Sheesh. The save the learners in an array, and restore them yourself on any failure to up

[Rails] Re: HABTM: join table records being deleted & not restored when validation fails

2010-02-19 Thread Ian
After a little bit of testing, this plugin seems to solve the problem. Thanks. On Feb 18, 6:43 pm, "kwe...@pobox.com" wrote: > > ... what I'm seeing is that even though Rails is displaying the error > > message, it's still deleting the associated records in the join table, > > learners_sessions.

[Rails] Hooking validates

2010-02-19 Thread Ralph Shnelvar
I want to hook the validation routines so that I can flag html labels and change their color to better indicate which fields need to be corrected in a form. Is there a way to do this conveniently and/or conventionally? -- Posted via http://www.ruby-forum.com/. -- You received this message becau

[Rails] Re: HABTM: join table records being deleted & not restored when validation fails

2010-02-19 Thread Ian
UI wise, that ends up being a bit awkward. The user thinks they've deselected all learners, but if they edit the page again, all the learners are still selected. On Feb 19, 3:05 am, Michael Pavling wrote: > On 18 February 2010 21:47, Ian wrote: > > > params[:session][:learner_ids] ||= [] > > > i

[Rails] Re: Cannot install Rails with Gems on WIndows

2010-02-19 Thread Sébastien Clément
Sharagoz -- wrote: >> HOMEDRIVE=P: > Your problem is probably there. > Run "set HOMEDRIVE=C:" > To verify that it has been set correctly run "echo %HOMEDRIVE%", which > should now print out "C:". Try to install rails. > > If that enables you to install gems you may want to edit the value > perma

[Rails] Re: Hooking validates

2010-02-19 Thread Frederick Cheung
On Feb 19, 4:14 pm, Ralph Shnelvar wrote: > I want to hook the validation routines so that I can flag html labels > and change their color to better indicate which fields need to be > corrected in a form. > > Is there a way to do this conveniently and/or conventionally? Have a look at field_err

[Rails] [SOLVED] Strange production vs. development behavior difference

2010-02-19 Thread pepe
Xavier, I had thought about that long ago and I was sure I was working with the right application. I don't have any other application with the same name anywhere in the system and the changes I was making to the views for debugging purposes were being processed just fine. However... I had a copy

[Rails] Escaping URL on routes.rb

2010-02-19 Thread Marcos Placona
Hi, this is my first time posting anything here, and I'd like to make you aware that I'm quite a newbie myself, so if this is a dull question, I'd like to offer my excuses. I'm working on this restful project of mine, and at some point I'll be sending emails to user with an URL, so they can get to

[Rails] Re: Unable to load file in testing

2010-02-19 Thread Hemant Bhargava
Colin Law wrote: > > Googling the error message suggests that this means that it cannot > find the fixtures file. How have you specified the fixtures in the > _test.rb file and what is the name of the holidays fixture file? > Thanks for a reply colin. In test_helper.rb file only i have specifie

Re: [Rails] Unable to load file in testing

2010-02-19 Thread Colin Law
On 19 February 2010 12:30, Hemant Bhargava wrote: > Hello champs, > > I am in testing phase of an application. I have created a simple test > case to add a holiday object like this:- > > def test_should_not_add_holiday_without_name >  holiday = Holiday.new >  assert !holiday.save, "Holiday not sav

[Rails] Re: Unable to load file in testing

2010-02-19 Thread Hemant Bhargava
Anyone listening me .. > Also how to tackle with plural names in testing.. I mean suppose i have > one more table leaves and while i'll test it, it will come something > like this:- "Unable to load leafe, underlying cause no such file to load > -- leafe" > > For this i know that set_fixture_class

[Rails] Re: Cannot install Rails with Gems on WIndows

2010-02-19 Thread Sharagoz --
> HOMEDRIVE=P: Your problem is probably there. Run "set HOMEDRIVE=C:" To verify that it has been set correctly run "echo %HOMEDRIVE%", which should now print out "C:". Try to install rails. If that enables you to install gems you may want to edit the value permanently to avoid future problems. T

[Rails] Re: restful authentication question

2010-02-19 Thread Robert Walker
Marnen Laibow-Koser wrote: > I've got lots of experience with restful_auth -- enough to know that it > depends on unmaintainable generated code and should not ever be used, > now that better alternatives exist. Try Authlogic instead. You'll be a > lot happier. +1 -- Posted via http://www.rub

Re: [Rails] Re: Weird gsub behaviour

2010-02-19 Thread Rob Biedenharn
On Feb 19, 2010, at 5:14 AM, stevo84 wrote: The exact problem a = '' b = '", str) So did you try: a.gsub("") { b } -Rob => quot;inputs invoice_linequot;>
    \n

Re: [Rails] Re: Strange production vs. development behavior difference

2010-02-19 Thread Xavier Noria
These kind of errors normally belong to the "editing the wrong file" bag. Can you double-check that the render :text is there with less(1) in the production machine? That that tree is the one being served? That you are pointing your browser to the correct machine? -- You received this message bec

[Rails] Re: JavaScript and cookies

2010-02-19 Thread Robert Walker
DanC wrote: > I hope this isn't a stupid question but I don't understand the 01010 = > 10 part? I was simply showing the 01010 in binary (0b01010) is equal to 10 in decimal. So in order to create a bit mask all you need to store is a simple integer (Fixnum). Example 1: Say your bit mask value

[Rails] Re: AJAX Problem

2010-02-19 Thread Nick Gins
Manish Belsare wrote: > "try { > Element.hide("add_answer_link_for_post_-613772418"); > Element.update("new_answer_form_for_post_-613772418", " action=\"/answers\" method=\"post\" onsubmit=\"new > Ajax.Request('/answers', {asynchronous:true, evalScripts:true, > parameters:Form.serialize(this)}); re

[Rails] Re: build_* not working despite being has_one

2010-02-19 Thread Frederick Cheung
On Feb 19, 1:45 pm, John Merlino wrote: >   def signup_success >     @user = User.find params[:id] >     @user.build_contact >   end > >   protected > > Any ideas why it doesn't create a corresponding contact? Thanks for any > response. Doesn't look like you save the contact at any point. Fre

[Rails] Re: Strange production vs. development behavior difference

2010-02-19 Thread pepe
Thanks Conrad, I knew about the caching and reloading differences, that is the reason I have been stopping and starting the web server every time while debugging the production environment. My understanding is that the web server will work with the application as if it were the first time it "saw"

[Rails] Re: Using Rails form helpers on non-existent methods

2010-02-19 Thread Marnen Laibow-Koser
Neil Middleton wrote: > Normally, when using form helpers in Rails, each field directly > correlates to a method on the appropriate object. > > However, I have a form (user signup) that needs to include fields that > are not part of the user model itself (for instance, card details) but > need to

[Rails] Re: Show parents subpages if on a subpage

2010-02-19 Thread Marnen Laibow-Koser
Lasse wrote: > Should acts_as_tree help me out? I'm not sure. But what doesn't work about your original code? Anyway, if you need a tree plugin, skip acts_as_tree and use awesome_nested_set. It's far more efficient for reads. Best, --  Marnen Laibow-Koser http://www.marnen.org mar...@marnen.o

[Rails] Re: Cannot install Rails with Gems on WIndows

2010-02-19 Thread Sébastien Clément
Aldric Giacomoni wrote: > Sébastien Clément wrote: >> I am using Windows Server 2007 SP2 > >> >> Then, starting the DOS console as an administrator and retyping the >> command gives the following result: >> >> - >> C:\>gem install rails >> ERROR: While executing gem ... (Err

[Rails] Re: Cannot install Rails with Gems on WIndows

2010-02-19 Thread Sébastien Clément
Sharagoz -- wrote: > The only thing I can think of is that something might be up with an > environment variable somewhere. If you run "set >> c:\dump.txt" from the > command line it will export the variables into that file. Post the > result here if you want us to have a look. Here is the resul

[Rails] build_* not working despite being has_one

2010-02-19 Thread John Merlino
Hey all, My intention here is just to create a corresponding contact when a user signs up, but the said contact is never created, despite using build_* with a has_one: User model: belongs_to :contact Users Controller: def signup @user = User.new end def signup_success @user = Use

[Rails] Re: Cannot install Rails with Gems on WIndows

2010-02-19 Thread Aldric Giacomoni
Sébastien Clément wrote: > I am using Windows Server 2007 SP2 > > Then, starting the DOS console as an administrator and retyping the > command gives the following result: > > - > C:\>gem install rails > ERROR: While executing gem ... (Errno::ENOENT) > No such file or di

[Rails] Re: Where to put require 'gem' statements?

2010-02-19 Thread Frederick Cheung
On Feb 19, 11:53 am, Martin Berli wrote: > Works perfectly. But generally, where is the place to put all those > require statements? Is it in config/environment.rb? Would it be correct > to add them just at the end of this file? > Well if it's a gem then using config.gem inside config/environme

Re: [Rails] Re: Authlogic Rails 3

2010-02-19 Thread Conrad Taylor
On Fri, Feb 19, 2010 at 1:08 AM, RaW wrote: > I think > $ script/generate > has been replaced with > $ r g > in Rails3 > > Am I right? > > You'll need to do the following in Rails 3: rails g model user_session Then just edit the file and you should be good to go. Good luck, -Conrad > -- > Y

[Rails] Unable to load file in testing

2010-02-19 Thread Hemant Bhargava
Hello champs, I am in testing phase of an application. I have created a simple test case to add a holiday object like this:- def test_should_not_add_holiday_without_name holiday = Holiday.new assert !holiday.save, "Holiday not saved without name" end In model, i have given validation as vali

Re: [Rails] Some fundamental architectural insights on the Ruby On Rails technology compared to Java

2010-02-19 Thread Xavier Noria
On Fri, Feb 19, 2010 at 10:41 AM, Krum Bakalsky wrote: > In the classical Ruby scenario, we write standalone applications, > which we run on Ruby VM (there are a lot of VMs, implemented in > different languages). But when it comes to writing Ruby web > applications on Rails, we need some more sop

Re: [Rails] deployment issues

2010-02-19 Thread Colin Law
On 19 February 2010 07:26, Farhad wrote: > PLEASE HELP!!! > I just did my first installation of ruby on rails. When I go to > www.mysite.com I get the following error: > > We're sorry, but something went wrong. > > We've been notified about this issue and we'll take a look at it > shortly. Have a

[Rails] Re: Using Rails form helpers on non-existent methods

2010-02-19 Thread Sharagoz --
You can use attr_accessor to create new model attributes that are not present in the database. For example, lets say you want to have a field "password" that the user types in, but this field is not going to be stored in the database. Instead the table will have a field "encrypted_password" tha

[Rails] Where to put require 'gem' statements?

2010-02-19 Thread Martin Berli
Hello, I've seen all sorts of places where people put their 'require' statements, and I'm not sure what the best solution is. I'm currently using it directly in a model/csv_processor.rb: require 'fastercsv' class CsvProcessor def self.create_csv_table(file) ... FCSV.parse(...

[Rails] Some fundamental architectural insights on the Ruby On Rails technology compared to Java

2010-02-19 Thread Krum Bakalsky
Hi guys, It's a pleasure for me to join your community mailing list. I am a keen software engineer and experimenter, and happen to investigate and dive into the Ruby language from a couple of weeks. So far i have become familiar with the basics of the syntax and semantics of the language, and, of

[Rails] Re: AJAX Problem

2010-02-19 Thread Sharagoz --
> This is the error.. That's not an error, thats the script that should be run on the page when the request completes. Are you sure you're submitting an ajax request, and not just a regular request? -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscrib

Re: [Rails] Re: Weird gsub behaviour

2010-02-19 Thread Xavier Noria
On Fri, Feb 19, 2010 at 11:48 AM, stevo84 wrote: > Argh - slashes missing -> here is the pastie code -> http://pastie.org/832493 Easier: "abc".gsub("b") { |_| str } There str is taken verbatim. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails:

[Rails] Re: Weird gsub behaviour

2010-02-19 Thread stevo84
Argh - slashes missing -> here is the pastie code -> http://pastie.org/832493 On 19 Lut, 11:46, stevo84 wrote: > It was received from already escaped html mixed with javascript - that > is why :( > I have no influence on the fact that these slashes are there... > > Anyway I have came up with a so

[Rails] Re: Weird gsub behaviour

2010-02-19 Thread stevo84
It was received from already escaped html mixed with javascript - that is why :( I have no influence on the fact that these slashes are there... Anyway I have came up with a solution - maybe there is a simpler way, however the code below works str = '\&123' puts "abc".gsub("b", str.gsub(

[Rails] Re: Show parents subpages if on a subpage

2010-02-19 Thread Priyanka Pathak
Lasse wrote: > Should acts_as_tree help me out? Hi, As you need hierarchical structure. and straight forward parent -> child relationship so, you will use acts_as_tree. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "

Re: [Rails] Re: Problem with assert_redirected_to

2010-02-19 Thread Peter Hickman
Damn I had that feeling, some of the code (and probably all the tests) was dragged in from a 2.1.1 project. Thanks. I will have to look into upgrading the project. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, se

[Rails] can't daemonize server with rails3

2010-02-19 Thread Fritzek
Hi folks when I start 'rails server -e test' it runs perfect (there is a process, I can find the server.pid file and run tests), but adding -d to the start command just shows the start of the server and nothing (no process, no pid file, no tests). And nothing in the logs to answer this. Same when

[Rails] Re: Problem with assert_redirected_to

2010-02-19 Thread Frederick Cheung
On Feb 19, 9:37 am, Peter Hickman wrote: > I have taken over some old Rails code and am trying to get the tests to run. > In the functional test every time the assertion 'assert_redirected_to' is > called I get the following error: Rails 2.0.2 isn;t compatible with ruby 1.8.7 - Rails 2.1 is the

[Rails] Re: Weird gsub behaviour

2010-02-19 Thread Frederick Cheung
On Feb 19, 8:47 am, stevo84 wrote: > ruby 1.8.6 (2007-09-24 patchlevel 111) > > str = '\&123' > puts "abc".gsub("b", str) > puts "abc".gsub("b", "#{str}") > puts "abc".gsub("b", str.to_s) > puts "abc".gsub("b", '\&123') > puts "abc".gsub("b", "\&123") Why are you escaping the & at all ? str =

Re: [Rails] Re: First time rails install, help with gems

2010-02-19 Thread kannav rajeev
can you tell the Os you using on which you wanna intsall it On Fri, Feb 19, 2010 at 3:29 PM, Priyanka Pathak wrote: > Hi, > As you want to install ruby on rails on linux system. so refer this > url > http://wiki.rubyonrails.org/getting-started/installation/linux > -- > Posted via http://www.rub

Re: [Rails] Re: Weird gsub behaviour

2010-02-19 Thread Xavier Noria
Not sure I understand. From a&123c<--- This I want to achieve using temporary I ask, do you know that & does not need escaping? "abc".gsub("b", "&123") # => "a&123c" -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. T

  1   2   >