[Rails] setup redmine to send E-MAIL using Gmail
I m using redmine project management software...can i add GUI interface to this.according to my reqirements... --~--~-~--~~~---~--~~ 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 rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Getting an exception in actionpack: "invalid byte sequence in US-ASCII" with ruby 1.9
After upgrading to Ruby 1.9 and Passenger, we started getting this while uploading a binary data file through a form. I'm not sure if it's ruby 1.9 or passenger, but either way, any help would be greatly appreciated. /!\ FAILSAFE /!\ 2009-05-28 00:39:30 + Status: 500 Internal Server Error invalid byte sequence in US-ASCII d /usr/local/lib/ruby/gems/1.9.1/gems/actionpack-2.3.2/lib/ action_controller/vendor/rack-1.0/rack/utils.rb:320:in `=~' /usr/local/lib/ruby/gems/1.9.1/gems/actionpack-2.3.2/lib/ action_controller/vendor/rack-1.0/rack/utils.rb:320:in `block in parse_multipart' /usr/local/lib/ruby/gems/1.9.1/gems/actionpack-2.3.2/lib/ action_controller/vendor/rack-1.0/rack/utils.rb:315:in `loop' /usr/local/lib/ruby/gems/1.9.1/gems/actionpack-2.3.2/lib/ action_controller/vendor/rack-1.0/rack/utils.rb:315:in `parse_multipart' /usr/local/lib/ruby/gems/1.9.1/gems/actionpack-2.3.2/lib/ action_controller/vendor/rack-1.0/rack/request.rb:125:in `POST' /usr/local/lib/ruby/gems/1.9.1/gems/actionpack-2.3.2/lib/ action_controller/vendor/rack-1.0/rack/methodoverride.rb:15:in `call' /usr/local/lib/ruby/gems/1.9.1/gems/actionpack-2.3.2/lib/ action_controller/params_parser.rb:15:in `call' /usr/local/lib/ruby/gems/1.9.1/gems/actionpack-2.3.2/lib/ action_controller/rewindable_input.rb:25:in `call' /usr/local/lib/ruby/gems/1.9.1/gems/actionpack-2.3.2/lib/ action_controller/session/cookie_store.rb:93:in `call' /usr/local/lib/ruby/gems/1.9.1/gems/actionpack-2.3.2/lib/ action_controller/failsafe.rb:11:in `call' /usr/local/lib/ruby/gems/1.9.1/gems/actionpack-2.3.2/lib/ action_controller/vendor/rack-1.0/rack/lock.rb:11:in `block in call' :8:in `synchronize' /usr/local/lib/ruby/gems/1.9.1/gems/actionpack-2.3.2/lib/ action_controller/vendor/rack-1.0/rack/lock.rb:11:in `call' /usr/local/lib/ruby/gems/1.9.1/gems/actionpack-2.3.2/lib/ action_controller/dispatcher.rb:106:in `call' /usr/local/lib/ruby/gems/1.9.1/gems/passenger-2.2.2/lib/ phusion_passenger/rack/request_handler.rb:81:in `process_request' /usr/local/lib/ruby/gems/1.9.1/gems/passenger-2.2.2/lib/ phusion_passenger/abstract_request_handler.rb:203:in `main_loop' /usr/local/lib/ruby/gems/1.9.1/gems/passenger-2.2.2/lib/ phusion_passenger/railz/application_spawner.rb:340:in `start_request_handler' /usr/local/lib/ruby/gems/1.9.1/gems/passenger-2.2.2/lib/ phusion_passenger/railz/application_spawner.rb:298:in `block in handle_spawn_application' /usr/local/lib/ruby/gems/1.9.1/gems/passenger-2.2.2/lib/ phusion_passenger/utils.rb:181:in `safe_fork' /usr/local/lib/ruby/gems/1.9.1/gems/passenger-2.2.2/lib/ phusion_passenger/railz/application_spawner.rb:296:in `handle_spawn_application' /usr/local/lib/ruby/gems/1.9.1/gems/passenger-2.2.2/lib/ phusion_passenger/abstract_server.rb:337:in `main_loop' /usr/local/lib/ruby/gems/1.9.1/gems/passenger-2.2.2/lib/ phusion_passenger/abstract_server.rb:187:in `start_synchronously' /usr/local/lib/ruby/gems/1.9.1/gems/passenger-2.2.2/lib/ phusion_passenger/abstract_server.rb:154:in `start' /usr/local/lib/ruby/gems/1.9.1/gems/passenger-2.2.2/lib/ phusion_passenger/railz/application_spawner.rb:192:in `start' /usr/local/lib/ruby/gems/1.9.1/gems/passenger-2.2.2/lib/ phusion_passenger/spawn_manager.rb:257:in `block (2 levels) in spawn_rails_application' /usr/local/lib/ruby/gems/1.9.1/gems/passenger-2.2.2/lib/ phusion_passenger/abstract_server_collection.rb:126:in `lookup_or_add' /usr/local/lib/ruby/gems/1.9.1/gems/passenger-2.2.2/lib/ phusion_passenger/spawn_manager.rb:251:in `block in spawn_rails_application' /usr/local/lib/ruby/gems/1.9.1/gems/passenger-2.2.2/lib/ phusion_passenger/abstract_server_collection.rb:80:in `block in synchronize' :8:in `synchronize' --~--~-~--~~~---~--~~ 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 rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Ruby on Rails giving error on HP-UX-ia64
Hi All, I'm trying to install RubyonRails on HP-UX 11.23[ia64-hpux11.23] machine. I was succesful in building Ruby1.8.7p160 and RubyGems1.3.2. #./ruby -v ruby 1.8.7 (2009-04-08 patchlevel 160) [ia64-hpux11.23] #./gem -v 1.3.2 Also my basic Ruby programs are working fine. On Installing RubyRails I got installation successful message: #gem install rails Successfully installed rake-0.8.7 Successfully installed activesupport-2.3.2 Successfully installed activerecord-2.3.2 Successfully installed actionpack-2.3.2 Successfully installed actionmailer-2.3.2 Successfully installed activeresource-2.3.2 Successfully installed rails-2.3.2 7 gems installed Installing ri documentation for rake-0.8.7... Installing ri documentation for activesupport-2.3.2... Installing ri documentation for activerecord-2.3.2... Installing ri documentation for actionpack-2.3.2... Installing ri documentation for actionmailer-2.3.2... Installing ri documentation for activeresource-2.3.2... Installing RDoc documentation for rake-0.8.7... Installing RDoc documentation for activesupport-2.3.2... Installing RDoc documentation for activerecord-2.3.2... Installing RDoc documentation for actionpack-2.3.2... Installing RDoc documentation for actionmailer-2.3.2... Installing RDoc documentation for activeresource-2.3.2... However when i run ./rails i get following error: # ./rails undefined method `camelize' for "app":String Please help me in resolving this error. I saw similar error posts but could not conclude what the problem actually is. Thanks in advance for the help :) --~--~-~--~~~---~--~~ 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 rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] SubDomain Queries
Hi, I have a requirement in my rails application where i need to provide access to a blog from another domain. e.g: blog.company.com should point to my app's blog_controller's show action. Is this possible. & if it is possible, will the user see: 1. blog.company.com/blog/some-blog 2. myapp.com/blog/some-blog I read a lot about Subdomain_fu. But i think it can only emulate subdomains in my own app. like (blog.myapp.com) or (company.blog.myapp.com). I really need help on this. Any pointers or suggestions are always welcome. Regards -- Sahil --~--~-~--~~~---~--~~ 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 rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: Calendar Plugin
http://github.com/search?type=Repositories&language=rb&q=calendar&repo=&langOverride=&x=16&y=23&start_value=1 A lot of calendar plugins aren't going to be ready for translation if you decide to go the the i18n route. Something to keep in mind when choosing. Cheers, Walter --~--~-~--~~~---~--~~ 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 rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] js problem
how to give the tooltip text in my application? i use js for that but it can't work so what to do? -- 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 rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] autocomplete fill in text fields
If you have an autocomplete and you have several text fields that have the other columns from the db. How do you autocomplete on a box and when you select it it fills in the other text fields with the rest of the data from the table? --~--~-~--~~~---~--~~ 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 rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: plz help to correct my query
Marnen Laibow-Koser wrote: > Venkat Eee wrote: >> Hi, >> >> I want to display both terminal_id and user_id. > [...] > > Where is user_id supposed to come from? It's not clear from looking at > your query. > > Best, > -- > Marnen Laibow-Koser > http://www.marnen.org > mar...@marnen.org Hi, user_id is a field in timings table. -- 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 rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: under MVC, business rules belong in the __________
Phlip wrote: > Regardless of the direction data travels travel. sorry --~--~-~--~~~---~--~~ 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 rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: I need a lot of advice here - let's start from the beginning
Simon Macneall wrote: > try sudo gem install > Or, rather, same error as above (minus the writeable issues) -- 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 rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: I need a lot of advice here - let's start from the beginning
Simon Macneall wrote: > try sudo gem install > Tried that already - same error... -- 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 rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: Would ROR be a good choice to build my site?
Utilizing Wordpress & VBulletin together with Rails isn't the best idea. It's do-able but it's the way Rails was intended to be used... so whoever does it will need to jump through hoops. I'd recommend looking at Rails based alternatives. Beast & Rboard are open source projects for forums. On the blogging side, there isn't anything as nice as Wordpress on Rails but you might look at Typo, Mephisto & BrowserCMS. On the video uploading side, you've got Panda (http://pandastream.com) you could utilize to upload & process videos. For the rest of the project, Rails would be a good fit, particularly since it sounds like you'll mostly be doing CRUD operations (Create, Read, Update & Delete on records.) Overall, my answer to your question is Yes. Rails is well suited for your app. On May 28, 8:45 pm, Jack Jackson wrote: > Would ROR be a good choice to build my site? > > Hi Gang, > > I'm in the process of developing a social media-ish site built around > WordPress and VBulletin forum. A site where a visitor has a username and > password and their own "page" on the site where various site > interactions take place. I need a CMS framework to tie them all together > along with other features like multimedia, video uploading/severing/, > news/articles/information as well as user/visitor created content ala/ > wiki's. I'll need a user-friendly backend to control the functionality. > (aside from Wordpress and VBulletin's existing backends) > Would ROR be suited for this sort of development? I'm going to be hiring > a developer very soon and would like to have some honest opinions from > those that know the platforms best. My current direction has me leaning > toward Joomla or Drupal but I've heard so much about ROR lately, I want > to find out more about it and if it's the best choice for my project. > > I hope to hear some good opinions. Thanks. > -- > Posted viahttp://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 rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: under MVC, business rules belong in the __________
Jeff Schwab wrote: > That's how I was taught MVC, long before I'd heard of Ruby: Models do > some basic checking, but business logic belongs in the controller. That > was the point of the controller; it gave a central place to put business > logic. Could you cite? It's flat-out wrong, and a friend of mine seems to have flubbed an interview by stating the correct answer. The Model should store things your boss says, like "client X can handle Visas and Mastercards, but client Y can handle only Visas". Business rules. Because controllers are busy controlling, you can't refactor the crap out of them, to leverage tricks like inheritance. X could inherit Y, and add Mastercard handling. (Please note that's a contrived example that would not withstand even cursory domain-driven analysis!;) Models have only one predefined role - persistence into a database - so they are free to otherwise refactor their logic around until it's DRY. If you wrote a non-trivial Rails app without this refactoring and designing, your controllers are going to rapidly devolve into unmanageable brambles of tangled thorny logic... In a system where the controllers are not so constrained (CGI, Ajax, HTTP, etc.) they are free to refactor into more subtle designs. Some projects, using other platforms, could conceivably store lots of business rules in objects that also control. That still does not mean it's a good idea. >> The Model should be as fat as possible. Anything a user can do to the biz >> rules, >> thru the View, unit test can do to the Model directly. > > That's not necessarily true. That is extremely necessarily true. Defining designs in terms of how to test-drive their creation is a simple but powerful way to explain generic design guidelines. Think, for example, of the tests required to generate one of the designs in the book /Design Patterns/. When you are writing an application, you should respond to the business rules in your requirements by TDDing them into your models first, then wiring them up to your Views. There's simply no counter-example for this practice. >> So the question is: Where did this disinformation come from? Do any websites >> (or >> >cough< books) out there actually say the biz rules belong in the >> controller? > > I first used MVC with MFC, about 10+ years ago, and in Java shortly > thereafter. Fat controllers may have been advocated by MS back then. MFC exploits "vendor lock-in" by tempting you with a wizard. I suspect Rails is an example of a competing platform that simply doesn't need one! Beyond script/generate... -- Phlip --~--~-~--~~~---~--~~ 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 rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: I need a lot of advice here - let's start from the beginning
try sudo gem install On Fri, 29 May 2009 11:59:03 +0800, J. D. wrote: > > Hi everyone - thanks for all of the input. Here's an update: > > I did install VirtualBox on my Vista and got the latest ubuntu and > created a virtual drive etc., installing it. > > I'm now up and running with Vista and Ubuntu > > I managed to figure out how to install ruby with a sudo command. But, > having a lot of other issues. I'm not all that familiar with linux so > here's the list of issues I'm experiencing: > > I'm currently using ruby1.8.7 (2008-08-11 patchlevel 72) [i486-linux] > according to ruby -v. > > I managed to get rubygems by typing sudo apt-get install rubygems1.8 and > that installed the gems system. > > I did gems install rails and got a strange error saying that I don't > have /home/elricstorm/.gem/ruby/1.8/bin in your path... > > I went out on the web and figured out how to change path by doing.. --~--~-~--~~~---~--~~ 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 rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: I need a lot of advice here - let's start from the beginning
Hi everyone - thanks for all of the input. Here's an update: I did install VirtualBox on my Vista and got the latest ubuntu and created a virtual drive etc., installing it. I'm now up and running with Vista and Ubuntu I managed to figure out how to install ruby with a sudo command. But, having a lot of other issues. I'm not all that familiar with linux so here's the list of issues I'm experiencing: I'm currently using ruby1.8.7 (2008-08-11 patchlevel 72) [i486-linux] according to ruby -v. I managed to get rubygems by typing sudo apt-get install rubygems1.8 and that installed the gems system. I did gems install rails and got a strange error saying that I don't have /home/elricstorm/.gem/ruby/1.8/bin in your path... I went out on the web and figured out how to change path by doing.. PATH=$PATH:/home/elricstorm/.gem/ruby/1.8/bin export PATH I tried installing hpricot, mysql, a few others and keep getting the following error: WARNING: Installing to ~/.gem since /var/lib/gems/1.8 and /var/lib/gems/1.8/bin aren't both writable... Building native extensions. This could take a while... Error: Error installing mysql: ERROR: Failed to build gem native extension. /usr/bin/ruby1.8 extconf.rb install mysql extconf.rb:1:in `require`: no such file to load --mkmf (LoadError) from extconf.rb: 1 .. I get this for a few gems, similar... Any help with my newbish run at linux would be appreciated. Also, what should I be using for an editor to program with on linux.. On windows I just used Scite.. -- 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 rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: shorten a link
I have @article.url and I want to parse that url. When I tried: @homepage = URI.parse(@article.url).host in the controller I simply got a blank output. -- 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 rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: under MVC, business rules belong in the __________
>>> Subsequent variations of MVC, particularly those which piled >>> application logic into the controller are perversions of the original >>> idea. >> "Perversions." You know, there are ways of making a point that don't >> involve blanket insults of everyone who disagrees with you. Mr. Manners reminds the Gentle Poster(s) that the early 1980s were, indeed, quite perverse... -- Phlip --~--~-~--~~~---~--~~ 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 rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: under MVC, business rules belong in the __________
Brian wrote: > I'm new to both rails and MVC, so please correct me if I > misunderstand. But it seems that controllers DO handle user input for > the typical web application. A view helps a user format that input, > but it can't receive anything. In fact, I could just send an http > request to a rails application before ever interacting with UI. The > controller is what processes this request, consulting models if > necessary. The view isn't involved until the application tries to > send information back to me. Regardless of the direction data travels, a controller should dispatch to the view or model as soon as possible. For example... Model.create! params[:model] That common idiom passes parameters directly into the createe, in the model. This might look like a violation of the rule "no view data leaking into the model", where the params[] are indeed CGI Query details wrapped up in a convenient package, but note that params[:model] should only contain data primitives - strings and strung integers. In real life coding, actions can get thick. They might need to use lots of if statements to triage input, for example. The rule "all biz logic in the model" is not a rule, it is a goal. The closer you get to it, and the more often you refactor a design towards that goal, the better. -- Phlip --~--~-~--~~~---~--~~ 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 rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Would ROR be a good choice to build my site?
Would ROR be a good choice to build my site? Hi Gang, I'm in the process of developing a social media-ish site built around WordPress and VBulletin forum. A site where a visitor has a username and password and their own "page" on the site where various site interactions take place. I need a CMS framework to tie them all together along with other features like multimedia, video uploading/severing/, news/articles/information as well as user/visitor created content ala/ wiki's. I'll need a user-friendly backend to control the functionality. (aside from Wordpress and VBulletin's existing backends) Would ROR be suited for this sort of development? I'm going to be hiring a developer very soon and would like to have some honest opinions from those that know the platforms best. My current direction has me leaning toward Joomla or Drupal but I've heard so much about ROR lately, I want to find out more about it and if it's the best choice for my project. I hope to hear some good opinions. Thanks. -- 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 rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: I need a lot of advice here - let's start from the beginning
On Fri, 29 May 2009 11:20:23 +0800, Marnen Laibow-Koser wrote: > > I should have been clearer. Based on the research I've done about > NetBeans, and on how the program is marketed, it seems that its > Eclipse-like nature and what I understand to be a heavy JRuby > implementation are not really the way I want to go about Rails > development. I might still try it, but I believe (if the info I have is > accurate) that it is the wrong direction to go for Rails, at least for > the way I like to work. > not sure what you mean by a heavy JRuby implementation. You can select which ruby to use. Out of the box it installs JRuby, but you can switch this to normal ruby easy enough. >> > I wasn't exactly talking about problems. I never really had any > *problems* as such with Rails and Eclipse. It just got to feel like > trying to run wearing ski boots after a while, and I didn't like that. > I had that feeling trying to use Eclipse for both C++ and Java. I think it is an offshoot of the fact it is written in Java, whereas (and I might be corrected here) Netbeans is written in C++. > I'll turn around the question: why NetBeans? What makes such an > apparently heavy IDE worthwhile for Rails? I'd be very interested to > know. > We were already using Netbeans for our Java dev, so it was natural to try it for Rails. The debugging is pretty good, and the project management side seems better than Eclipse (that said, I haven't tried eclipse for several years now). I guess mostly, once you are using it, there isn't anything that is annoying me enough to want to try something else. Cheers Simon --~--~-~--~~~---~--~~ 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 rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: Asking for help with operating on data
eggman2001 wrote: > I have a few thousand rows of stock market data - one row for each > day. I'm using ActiveRecord to perform database operations. > > I'm interested in performing a calculation on each row while > incorporating the result of the calculation on the previous row [...] > I figure that I'll start with an array of size 3,000. Then I would > probably want to iterate over it, possibly saving the result of the > operation of each row to a new array but this area is a little foggy. > > Any suggestions? Well, some ideas: * Get the whole dataset (or each batch of 3000) into memory with one query before operating. No sense in making the database bottleneck any worse than it has to be. * Find a way to do the calculations on the DB side, using aggregate functions and/or (gasp!) stored procedures. This will probably be easier if you're using PostgreSQL or Oracle, since mySQL's procedural language is so weak as to be unusable for non-trivial work. * Provide more detail and we might be able to help more. Best, -- Marnen Laibow-Koser http://www.marnen.org mar...@marnen.org -- 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 rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: I need a lot of advice here - let's start from the beginning
Simon Macneall wrote: > Heh? > > you are disagreeing rather strongly based on a program that you have > never > used? I should have been clearer. Based on the research I've done about NetBeans, and on how the program is marketed, it seems that its Eclipse-like nature and what I understand to be a heavy JRuby implementation are not really the way I want to go about Rails development. I might still try it, but I believe (if the info I have is accurate) that it is the wrong direction to go for Rails, at least for the way I like to work. > > We use netbeans as our Rails dev environment, and have had no problems > at > all. I wasn't exactly talking about problems. I never really had any *problems* as such with Rails and Eclipse. It just got to feel like trying to run wearing ski boots after a while, and I didn't like that. I'll turn around the question: why NetBeans? What makes such an apparently heavy IDE worthwhile for Rails? I'd be very interested to know. Best, -- Marnen Laibow-Koser http://www.marnen.org mar...@marnen.org -- 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 rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: I need a lot of advice here - let's start from the beginning
Heh? you are disagreeing rather strongly based on a program that you have never used? We use netbeans as our Rails dev environment, and have had no problems at all. On Fri, 29 May 2009 11:05:46 +0800, Marnen Laibow-Koser wrote: > > Jim wrote: > [...] >> I recommend using Netbeans as a development environment after you do >> your first couple of projects. > > I'm going to disagree rather strongly here. Rails doesn't seem to lend > itself all that well to "heavy" IDEs like Eclipse (which I used to use, > and would probably still use for Java) and NetBeans (haven't used, but > seems like the same niche). I've had much better luck with simpler > tools like jEdit (see http://marnen.livejournal.com for setup info) and > KomodoEdit (my current choice), or even plain editors like TextWrangler. > > (BTW, Eclipse and NetBeans *still* don't do word wrap reliably. WTF?) > > Best, > -- > Marnen Laibow-Koser > http://www.marnen.org > mar...@marnen.org --~--~-~--~~~---~--~~ 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 rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: I need a lot of advice here - let's start from the beginning
Jim wrote: [...] > I recommend using Netbeans as a development environment after you do > your first couple of projects. I'm going to disagree rather strongly here. Rails doesn't seem to lend itself all that well to "heavy" IDEs like Eclipse (which I used to use, and would probably still use for Java) and NetBeans (haven't used, but seems like the same niche). I've had much better luck with simpler tools like jEdit (see http://marnen.livejournal.com for setup info) and KomodoEdit (my current choice), or even plain editors like TextWrangler. (BTW, Eclipse and NetBeans *still* don't do word wrap reliably. WTF?) Best, -- Marnen Laibow-Koser http://www.marnen.org mar...@marnen.org -- 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 rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Asking for help with operating on data
I have a few thousand rows of stock market data - one row for each day. I'm using ActiveRecord to perform database operations. I'm interested in performing a calculation on each row while incorporating the result of the calculation on the previous row, and then once the calculation has been performed for all rows, perform a new calculation that uses the individual calculations of each row. I figure that I'll start with an array of size 3,000. Then I would probably want to iterate over it, possibly saving the result of the operation of each row to a new array but this area is a little foggy. Any suggestions? --~--~-~--~~~---~--~~ 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 rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: ActiveScaffold - undefined method `link' for #
Just found more information on this problem at http://groups.google.com/group/activescaffold/browse_thread/thread/81463160ad0089da# and http://groups.google.com/group/activescaffold/browse_thread/thread/d8dca7665dc5b9f2# It seems the problem is quite new, perhaps from an incomplete commit done earlier today. Problem has been logged at http://github.com/activescaffold/active_scaffold/issues Tim On May 28, 4:28 pm, enwood wrote: > Has anyone encountered this error message with the ActiveScaffold > plugin? > > I'm working on Windows XP (yes) with Ruby 1.8.6 and Rails 2.3.2. I > just created a new, fresh Rails application with a single model > ("users"), installed the ActiveScaffold plugin, and followed the other > two steps in the ActiveScaffold Getting Started tutorial. > > When I run the app, and browse to the resource > (e.g.http://localhost:3000/users) > I immediately see the following: > > NoMethodError in UsersController#index > > undefined method `link' for # 0x4774e90> > > Look familiar? What am I missing? I haven't done anything to the > application except what was required by the tutorial. > > Am I the *only* developer trying this plugin under Windows? > > Many thanks for any pointers. > Tim --~--~-~--~~~---~--~~ 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 rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: I need a lot of advice here - let's start from the beginning
The other thing to consider (I had a quick look at VirtualBox the other day) is that the VMWare vms are portable across OSs, while VirtualBox's aren't So, if you are using vmware, your dev vm on vista will run on vmware player on Linux, but this doesn't apply for VirtualBox. However, they have some sound reasons for this, including making the vm files smaller. On Fri, 29 May 2009 09:36:15 +0800, Jim wrote: > > Yup, you are correct. It's possible to download a VMware appliance > that has Ubuntu. I actually haven't tried any premade appliances > yet. > > I used to use VMware server until they changed it so I couldn't really > use it as standalone. I'm using VMware player now but using my own > empty template so I can set up any OS I want. --~--~-~--~~~---~--~~ 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 rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: I need a lot of advice here - let's start from the beginning
Yup, you are correct. It's possible to download a VMware appliance that has Ubuntu. I actually haven't tried any premade appliances yet. I used to use VMware server until they changed it so I couldn't really use it as standalone. I'm using VMware player now but using my own empty template so I can set up any OS I want. On May 28, 9:18 pm, "Simon Macneall" wrote: > We are using VMWare on Vista, and having no problems. I have had a bit of > a look at VirtualBox, but the tools for vmware seem a bit more complete. > On the 'harder to set up' issue, there are appliances that you can > download that are pretty much a complete ubuntu vm. Just download and away > you go. > > Cheers > Simon > > On Fri, 29 May 2009 09:13:32 +0800, Jim wrote: > > > I use Vista Business edition. You shouldn't have any problems with > > VirtualBox. I use Vmware player, but it's a bit harder to setup > > initially so I can't recommend that for now. Just download the Ubuntu > > iso file from ubuntu.com and use that as a cd image in virtualbox. > > The instructions for installing Ubuntu as straight forward. I > > recommend 8GB disk space on virtualbox for this. > > > Here's a great link for installing RoR on Ubuntu 8.04. > >http://www.rubyhead.com/2008/04/25/installing-ruby-rails-on-ubuntu-80... > > > I don't know what your background in programming is, but Programming > > Ruby would be good to read after ~100pages of the Rails book. If you > > need more background in programming, maybe the Learn to Program book > > might be useful. You'll only need basic linux commands for most of > > what you'll do. Quick google searches will help you. I haven't read > > any linux books, so I can't suggest anything. I think you'll be > > surprised at how easy Ubuntu will be to use. > > > I recommend using Netbeans as a development environment after you do > > your first couple of projects. Do the first projects following the > > book as it will give you a good foundation for understanding how > > things work. > > > On May 28, 8:34 pm, "J. D." wrote: > >> Jim wrote: > >> > 1,2. I would highly recommend doing it on Linux. You can easily do > >> > this while still using Windows by using virtual machine software such > >> > as VirtualBox(virtualbox.org) or Vmware(vmware.com). Go with > >> > Virtualbox. It's pretty good and easy to use and FREE. You won't > >> > have to worry about rebooting or dual-booting. It will let you run > >> > Linux under Windows. So, just install Ubuntu into it. I recommend > >> > Ubuntu 8.04 desktop. Afterwards, just google how to install RoR onto > >> > Ubuntu 8.04 and you'll get a couple of good pages with great step by > >> > step instructions. It won't as hard as you think. > > >> > 3. I found the Agile Web Dev with Rails book to be very good for > >> > getting started over a year ago. It takes you through a simple > >> > project and get your familiar with the basic stuff. Afterward it runs > >> > through more detailed information you'll probably want to also use. > > >> > 4. If your deployment environment is Linux, then go development in > >> > Linux. It'll make your life easier when you encounter and solve > >> > problems on linux during development instead of running into them when > >> > you deploy. > > >> > Good luck. > > >> Jim - thanks a ton. > > >> I will look into VirtualBox and see how it fares with Vista, before > >> installing. > > >> Here are a list of the books I have (currently) (I have PDF formats > >> (digital licenses) for the following: > > >> Agile Web Development with Rails (I'll read this one next) > >> Beginning Ruby - From Novice to Professional (the one I've read so far) > >> Practical Ruby Gems > >> Enterprise Integration with Ruby > >> Everyday Scripting with Ruby > >> Learn to Program > >> OReilly - Shortcut RJS Templates for Rails > >> OReilly - Web Services on Rails > >> Programming Ruby > >> Rails Recipes > > >> That's my current list... > > >> What would you recommend for linux use (as far as a book to read about > >> it) - I'll go with ubuntu.. > > >> -- > >> Posted viahttp://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 rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: I need a lot of advice here - let's start from the beginning
We are using VMWare on Vista, and having no problems. I have had a bit of a look at VirtualBox, but the tools for vmware seem a bit more complete. On the 'harder to set up' issue, there are appliances that you can download that are pretty much a complete ubuntu vm. Just download and away you go. Cheers Simon On Fri, 29 May 2009 09:13:32 +0800, Jim wrote: > > I use Vista Business edition. You shouldn't have any problems with > VirtualBox. I use Vmware player, but it's a bit harder to setup > initially so I can't recommend that for now. Just download the Ubuntu > iso file from ubuntu.com and use that as a cd image in virtualbox. > The instructions for installing Ubuntu as straight forward. I > recommend 8GB disk space on virtualbox for this. > > Here's a great link for installing RoR on Ubuntu 8.04. > http://www.rubyhead.com/2008/04/25/installing-ruby-rails-on-ubuntu-804-hardy-heron/ > > I don't know what your background in programming is, but Programming > Ruby would be good to read after ~100pages of the Rails book. If you > need more background in programming, maybe the Learn to Program book > might be useful. You'll only need basic linux commands for most of > what you'll do. Quick google searches will help you. I haven't read > any linux books, so I can't suggest anything. I think you'll be > surprised at how easy Ubuntu will be to use. > > I recommend using Netbeans as a development environment after you do > your first couple of projects. Do the first projects following the > book as it will give you a good foundation for understanding how > things work. > > > On May 28, 8:34 pm, "J. D." wrote: >> Jim wrote: >> > 1,2. I would highly recommend doing it on Linux. You can easily do >> > this while still using Windows by using virtual machine software such >> > as VirtualBox(virtualbox.org) or Vmware(vmware.com). Go with >> > Virtualbox. It's pretty good and easy to use and FREE. You won't >> > have to worry about rebooting or dual-booting. It will let you run >> > Linux under Windows. So, just install Ubuntu into it. I recommend >> > Ubuntu 8.04 desktop. Afterwards, just google how to install RoR onto >> > Ubuntu 8.04 and you'll get a couple of good pages with great step by >> > step instructions. It won't as hard as you think. >> >> > 3. I found the Agile Web Dev with Rails book to be very good for >> > getting started over a year ago. It takes you through a simple >> > project and get your familiar with the basic stuff. Afterward it runs >> > through more detailed information you'll probably want to also use. >> >> > 4. If your deployment environment is Linux, then go development in >> > Linux. It'll make your life easier when you encounter and solve >> > problems on linux during development instead of running into them when >> > you deploy. >> >> > Good luck. >> >> Jim - thanks a ton. >> >> I will look into VirtualBox and see how it fares with Vista, before >> installing. >> >> Here are a list of the books I have (currently) (I have PDF formats >> (digital licenses) for the following: >> >> Agile Web Development with Rails (I'll read this one next) >> Beginning Ruby - From Novice to Professional (the one I've read so far) >> Practical Ruby Gems >> Enterprise Integration with Ruby >> Everyday Scripting with Ruby >> Learn to Program >> OReilly - Shortcut RJS Templates for Rails >> OReilly - Web Services on Rails >> Programming Ruby >> Rails Recipes >> >> That's my current list... >> >> What would you recommend for linux use (as far as a book to read about >> it) - I'll go with ubuntu.. >> >> -- >> Posted viahttp://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 rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: I need a lot of advice here - let's start from the beginning
I use Vista Business edition. You shouldn't have any problems with VirtualBox. I use Vmware player, but it's a bit harder to setup initially so I can't recommend that for now. Just download the Ubuntu iso file from ubuntu.com and use that as a cd image in virtualbox. The instructions for installing Ubuntu as straight forward. I recommend 8GB disk space on virtualbox for this. Here's a great link for installing RoR on Ubuntu 8.04. http://www.rubyhead.com/2008/04/25/installing-ruby-rails-on-ubuntu-804-hardy-heron/ I don't know what your background in programming is, but Programming Ruby would be good to read after ~100pages of the Rails book. If you need more background in programming, maybe the Learn to Program book might be useful. You'll only need basic linux commands for most of what you'll do. Quick google searches will help you. I haven't read any linux books, so I can't suggest anything. I think you'll be surprised at how easy Ubuntu will be to use. I recommend using Netbeans as a development environment after you do your first couple of projects. Do the first projects following the book as it will give you a good foundation for understanding how things work. On May 28, 8:34 pm, "J. D." wrote: > Jim wrote: > > 1,2. I would highly recommend doing it on Linux. You can easily do > > this while still using Windows by using virtual machine software such > > as VirtualBox(virtualbox.org) or Vmware(vmware.com). Go with > > Virtualbox. It's pretty good and easy to use and FREE. You won't > > have to worry about rebooting or dual-booting. It will let you run > > Linux under Windows. So, just install Ubuntu into it. I recommend > > Ubuntu 8.04 desktop. Afterwards, just google how to install RoR onto > > Ubuntu 8.04 and you'll get a couple of good pages with great step by > > step instructions. It won't as hard as you think. > > > 3. I found the Agile Web Dev with Rails book to be very good for > > getting started over a year ago. It takes you through a simple > > project and get your familiar with the basic stuff. Afterward it runs > > through more detailed information you'll probably want to also use. > > > 4. If your deployment environment is Linux, then go development in > > Linux. It'll make your life easier when you encounter and solve > > problems on linux during development instead of running into them when > > you deploy. > > > Good luck. > > Jim - thanks a ton. > > I will look into VirtualBox and see how it fares with Vista, before > installing. > > Here are a list of the books I have (currently) (I have PDF formats > (digital licenses) for the following: > > Agile Web Development with Rails (I'll read this one next) > Beginning Ruby - From Novice to Professional (the one I've read so far) > Practical Ruby Gems > Enterprise Integration with Ruby > Everyday Scripting with Ruby > Learn to Program > OReilly - Shortcut RJS Templates for Rails > OReilly - Web Services on Rails > Programming Ruby > Rails Recipes > > That's my current list... > > What would you recommend for linux use (as far as a book to read about > it) - I'll go with ubuntu.. > > -- > Posted viahttp://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 rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: UserMailer return boolean value
Hey David The only thing I can think of here would be to set action mailer to raise delivery errors in your development and production environments: config.action_mailer.raise_delivery_errors = true and then add something like the following to the method that sends the mail: def my_mail_sending_method begin Mailer.deliver_my_email rescue return false # => returns false if any exceptions are raised end return true # => returns true if no exceptions are raised end There might be a better answer out there though? :s --~--~-~--~~~---~--~~ 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 rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: using js prompt() instead of a form with create method
On Thu, May 28, 2009 at 8:32 PM, Mk 27 wrote: > > I am thinking it is actually impossible to pass a client side javascript > variable into the server side rails without hiding a form somewhere... Well you can make an Ajax request, and pass the value of the javascript variable in a query parameter in the url. -- Rick DeNatale Blog: http://talklikeaduck.denhaven2.com/ Twitter: http://twitter.com/RickDeNatale WWR: http://www.workingwithrails.com/person/9021-rick-denatale LinkedIn: http://www.linkedin.com/in/rickdenatale --~--~-~--~~~---~--~~ 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 rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: I need a lot of advice here - let's start from the beginning
Jim wrote: > 1,2. I would highly recommend doing it on Linux. You can easily do > this while still using Windows by using virtual machine software such > as VirtualBox(virtualbox.org) or Vmware(vmware.com). Go with > Virtualbox. It's pretty good and easy to use and FREE. You won't > have to worry about rebooting or dual-booting. It will let you run > Linux under Windows. So, just install Ubuntu into it. I recommend > Ubuntu 8.04 desktop. Afterwards, just google how to install RoR onto > Ubuntu 8.04 and you'll get a couple of good pages with great step by > step instructions. It won't as hard as you think. > > 3. I found the Agile Web Dev with Rails book to be very good for > getting started over a year ago. It takes you through a simple > project and get your familiar with the basic stuff. Afterward it runs > through more detailed information you'll probably want to also use. > > 4. If your deployment environment is Linux, then go development in > Linux. It'll make your life easier when you encounter and solve > problems on linux during development instead of running into them when > you deploy. > > Good luck. Jim - thanks a ton. I will look into VirtualBox and see how it fares with Vista, before installing. Here are a list of the books I have (currently) (I have PDF formats (digital licenses) for the following: Agile Web Development with Rails (I'll read this one next) Beginning Ruby - From Novice to Professional (the one I've read so far) Practical Ruby Gems Enterprise Integration with Ruby Everyday Scripting with Ruby Learn to Program OReilly - Shortcut RJS Templates for Rails OReilly - Web Services on Rails Programming Ruby Rails Recipes That's my current list... What would you recommend for linux use (as far as a book to read about it) - I'll go with ubuntu.. -- 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 rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: using js prompt() instead of a form with create method
I am thinking it is actually impossible to pass a client side javascript variable into the server side rails without hiding a form somewhere... -- 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 rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] legacy db connection
Hello All. I need to connect to an older db that doesn't follow the rails naming structure. I can establish a connection ok and read data but am unable to join two tables together within that database. This is what I have: Legacy DB tables: --- mysql> describe frk_project; +-+---+--+-+-++ | Field | Type | Null | Key | Default | Extra | +-+---+--+-+-++ | projectId | mediumint(8) unsigned | NO | PRI | NULL| auto_increment | | name| varchar(120) | NO | | || | description | text | NO | | || +-+---+--+-+-++ mysql> describe frk_item; +--+---+--+-+++ | Field| Type | Null | Key |Default|Extra +--+---+--+-+++ | itemId | int(10) unsigned | NO | PRI | NULL |auto_increment | projectId| mediumint(8) unsigned | NO | MUL | 0 | title| varchar(255) | NO | | | description | text | NO | | Rails Models: --- class Freak_Item < ActiveRecord::Base ActiveRecord::Base.establish_connection( :adapter => "mysql", :encoding => "utf8", :username => "root", :database => "taskfreak", :socket => "/var/lib/mysql/mysql.sock" ) self.table_name = 'frk_item' self.primary_key = 'itemId' belongs_to :freak_project end --- class Freak_Project < ActiveRecord::Base ActiveRecord::Base.establish_connection( :adapter => "mysql", :encoding => "utf8", :username => "root", :database => "taskfreak", :socket => "/var/lib/mysql/mysql.sock" ) self.table_name = 'frk_project' self.primary_key = 'projectId' has_many :freak_items, :foreign_key => "projectId" end --- Am I missing something in the models ? Thanks, any help appreciated...Bill -- 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 rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] using js prompt() instead of a form with create method
I have a new/create method that only has one field, and I'd rather use a js prompt() to get the data instead of a form. The trigger for this is not a link, it's a span. Using "onclick" in the span, how can I call a prompt(), return the single param to the contoller "create" method, and then call the controller "list" method to update the page? -- 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 rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: under MVC, business rules belong in the __________
On Thu, May 28, 2009 at 11:29 AM, Jeff Schwab wrote: > > Rick DeNatale wrote: >> The Model holds the domain >> information and methods for processing it. >> >> The View is concerned only with presenting the view to the user, a >> model might have multiple views presenting different subsets and/or >> projections of the model. >> >> The Controller deals with communicating with the user, it processes >> user input, and decides which views should be rendered and where. > > That's different from any form of MVC I've ever heard of, including > Rails. Ordinarily, the views define the UI, and the Controller exists > strictly behind the scenes, as implementation details. By UI I mean both output and input. And the Controller and View are both involved. >> So the Rails notion of MVC seems very similar to this 1979 version. >> Controllers process user input and decide which view to render, Views >> do the rendering, and Models do the heavy application lifting. > > That's not how Rails works. You're mostly right about the Models, but > the controllers are, as Phlip suggested, just "patch boards," not for > user input. Sometimes a savvy user can send HTTP requests to a Rails > application without going through any view, but that's not the intent. No, I really understand how Rails, HTTP browsers work, and I maintain that controllers handle input and decide how to change what the user sees in response. This is partially in response to a later response you made to Brian. if we step back and see how the user interacts with a web application through a browser, the first step is to make the initial request by getting the browser to send an http request to the app. This happens when he does something like typing a url into the address bar, or following a link. The http request, typically a get here is the input I'm talking about. That input in the form of a request is routed to a controller, which typically interacts with one or more models, then renders something. That something is typically an html page from a rendered view, but could also be json, javascript, or a partial dom replacement for an ajax call, often view are involved in the rendering of this response. The only thing that views have to do with input is to provide affordances by which the user may cause additional input requests to happen, whether they be links, buttons which generate ajax requests, etc. but the input is processed by the controller in the web application. > One piece of "heavy lifting" still done by the controllers is access > control; Models know how to answer questions, and don't intrinsically > care who's asking. It's up to the Controllers to determine who gets to > see what. Only in the simplest of access control. Usually there's model involvement here as well, although it's often not obvious because the controller interaction with the security model objects is done in before filters. >> Subsequent variations of MVC, particularly those which piled >> application logic into the controller are perversions of the original >> idea. > > "Perversions." You know, there are ways of making a point that don't > involve blanket insults of everyone who disagrees with you. As others have pointed out, you are over reacting to the word. The intention here was in the same sense as "a perversion of justice". No insult was intended. -- Rick DeNatale Blog: http://talklikeaduck.denhaven2.com/ Twitter: http://twitter.com/RickDeNatale WWR: http://www.workingwithrails.com/person/9021-rick-denatale LinkedIn: http://www.linkedin.com/in/rickdenatale --~--~-~--~~~---~--~~ 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 rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: I need a lot of advice here - let's start from the beginning
1,2. I would highly recommend doing it on Linux. You can easily do this while still using Windows by using virtual machine software such as VirtualBox(virtualbox.org) or Vmware(vmware.com). Go with Virtualbox. It's pretty good and easy to use and FREE. You won't have to worry about rebooting or dual-booting. It will let you run Linux under Windows. So, just install Ubuntu into it. I recommend Ubuntu 8.04 desktop. Afterwards, just google how to install RoR onto Ubuntu 8.04 and you'll get a couple of good pages with great step by step instructions. It won't as hard as you think. 3. I found the Agile Web Dev with Rails book to be very good for getting started over a year ago. It takes you through a simple project and get your familiar with the basic stuff. Afterward it runs through more detailed information you'll probably want to also use. 4. If your deployment environment is Linux, then go development in Linux. It'll make your life easier when you encounter and solve problems on linux during development instead of running into them when you deploy. Good luck. On May 28, 4:48 pm, "J. D." wrote: > Hi Everyone, > > I'll try to make my opening summary as short as possible. I work as a > hobbyist in web development (using Dreamweaver CS4, Photoshop CS4, PHP, > Swishmax2(flash)). My dominant sites are all on "linux/unix" boxes but > I program on a Windows Vista machine. I program for fun with C++, > Autoit, Actionscript, and PHP for the most part. My background is that > I've been in the IT industry for more than 16 years and I'm an extreme > troubleshooter but I'm also a Windows System Administrator. That > basically means I'm a jack of all trades where windows is concerned > because I've seen a lot of things over the years as I dabble a lot. > > I have a photographic memory with a logical foundation set within. > Therefore, I learn a lot faster than most people because I can retain > information like a sponge to water. > > I have a lot of time available (in-between job searches right now) so I > decided to spend my time wisely. About one week ago, I decided to push > into Ruby with the idea that I'll eventually get into Ruby on Rails. > I've researched it and it's the route I want to go. > > Anyhoo, I do not use linux and am not very familiar with linux. Some > folks say it's not hard to use Ruby on windows and it's come a long way > so I started pulling in some research materials. Here's what I've > accomplished in one week so far: > > I read my first ruby book (Beginning Ruby - From Novice to Professional) > by Peter Cooper. > > I installed Ruby using the one-click-installer > I learned how to install and use gems. > I learned the difficulty with installing gems that needed > --platform=mswin32 > I created my first program from scratch (an html parser I called > scraper.rb) which pulls statistics off a website and stores it in yaml. > > I was instantly thrilled with the concept of classes, methods, even > happy with how interpolation worked with variables. I thought to myself > this is going to be great! I can design a class based app that can > become modular as I build it and not suffer through past programming > experiences. > > I was just about to get into RoR when I thought to myself it might be > better to go with the latest ruby. So, I managed to upgrade my ruby to > 1.9.1. I ordered another book from O'Reilly which is supposed to help > with transitions from 1.8 - 1.9. I found out there were a lot of issues > upgrading, namely with how a lot of the gems I used to be able to use no > longer worked. > > The biggest issues I face now are using mysql on windows and also that > my DBs online are 5.1. Keep in mind the online DBs are in fact on a > linux/unix box and not on a windows but I do my programming on a windows > box. Make sense? I hope so. It's just a convenience for me because > I'm more fluent with windows. > > However, now I cannot get mysql to work. I did work through a lot of > websearches and found the best install fix for me was something like: > > gem install kwatch-mysql-ruby --platform=mswin32 > --source=http://gems.github.com/ > > However, when I tried to install it, I get the following error: > > *** ERROR: can't find mysql client library. > *** extconf.rb failed *** > > I use mysql 5.1 on my windows machine and use Wampserver as my original > development server/platform. > > So, I'm a little frustrated but I know I can get through this. And, I > don't want to give up on Ruby at all. So, my questions are as follows: > > 1. What would you recommend I do concerning developing on a windows box > when my websites are located on linux/unix. Is it doable? Do I have to > make a lot of adjustments? > > 2. If I had to go to linux to use RoR effectively, how steep is the > learning curve going to be and what would I need to do to ensure that I > can dual-boot on both vista and linux where appropriate? > > 3. What other suggestions can you give me to h
[Rails] Re: under MVC, business rules belong in the __________
Michael Schuerig wrote: > On Thursday 28 May 2009, Jeff Schwab wrote: >> Phlip wrote: >>> Railsters: >>> >>> I heard a rumor that the incorrect answer, "Controller", was in >>> circulation out there. >> That's how I was taught MVC, long before I'd heard of Ruby: Models >> do some basic checking, but business logic belongs in the controller. >> That was the point of the controller; it gave a central place to put >> business logic. > > That sounds more like Jacobson's Entity-Boundary-Control. Is there a > chance you're thinking of that? No, what I'm describing was a dominant view of MVC in the late 90's. Of course, that doesn't make it right, and maybe it should have been called Entity-Boundary-Control. Thanks for giving me something to Google. --~--~-~--~~~---~--~~ 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 rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: dump and import MySQL table w/ accents
Quoting Jeffrey L. Taylor : > > I am switching to a composite primary key (string and user ID) from the Rails > conventional auto-incrementing integer primary ID. The table is large (2.5 > million records) and I'd rather not discard the contents. The > composite_primary_key gem doesn't appear to support altering the table with a > migration to do its magic, only creating a table from scratch. So I dumped > the table with mysqldump, ran the migration (table looks good), and am trying > to repopulate the table. It has accented characters and is complaining about > duplicates, apparently around words with and without accents, e.g., 'jose' and > 'josé'. I've been deleting one by hand from the dump, but it is tedious and > very slow. Emacs crawls when dealing with very large files with very long > lines. > > I just don't understand why the accents are causing problems. The string > column is utf8_general_ci collation, just like other fields in the database > with strings with accents. What do I need to specify so it will import the > dump? Is there a problem with strings with accents in composite indexes? > The answer is mixed and bits of it don't make sense. If I work with the MySQL client (mysql), I can create records with primary keys identical, except for an accent. Doing the same thing in the Rails console throws an DuplicateKey exception. Using mysqldump to dump the contents of a table, changing the table so the primary key is a integer-string composite and trying to repopulate the table from the mysqldump output also barfs on a duplicate key exception. It is non-optimal, but I can live for the moment with a table with two non-unique indexes. Jeffrey --~--~-~--~~~---~--~~ 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 rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: under MVC, business rules belong in the __________
On Thu, May 28, 2009 at 2:57 PM, Jeff Schwab wrote: > "Perversion" is an extremely derogatory term. That connotation may not > be expressed by your dictionary, but I assure you, "perverse" is a very > nasty way of referring to something, and implies strong disapproval. I'd suggest it's a serious mistake to assume your odd point of view -- which doesn't match up with either the m-w.com dictionary, or my own experience -- is shared by the majority. Your assurances notwithstanding :-) -- Hassan Schroeder hassan.schroe...@gmail.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 rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: under MVC, business rules belong in the __________
On Thursday 28 May 2009, Jeff Schwab wrote: > Phlip wrote: > > Railsters: > > > > I heard a rumor that the incorrect answer, "Controller", was in > > circulation out there. > > That's how I was taught MVC, long before I'd heard of Ruby: Models > do some basic checking, but business logic belongs in the controller. > That was the point of the controller; it gave a central place to put > business logic. That sounds more like Jacobson's Entity-Boundary-Control. Is there a chance you're thinking of that? Michael -- Michael Schuerig mailto:mich...@schuerig.de http://www.schuerig.de/michael/ --~--~-~--~~~---~--~~ 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 rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: under MVC, business rules belong in the __________
p_W wrote: > I didn't read it as an insult...according to the dictionary: > > 'perversions: a perverted form of something' > 'perverted: turned from what is right; misguided; distorted.' > > Then every MVC implementation that differs from the original is indeed > 'distorted' and therefore 'perverted' "Perversion" is an extremely derogatory term. That connotation may not be expressed by your dictionary, but I assure you, "perverse" is a very nasty way of referring to something, and implies strong disapproval. The most common use of the word is probably in relation to sex crimes. It's just not a nice thing to say. That doesn't mean Ron hasn't got the right to say it, especially if it accurately expresses his opinion; however, it's not something that ordinarily comes up in civil discourse. > Do we really need to try and interpret everything as flamebait? Do we really need to turn every intellectual debate into a struggle for personal superiority? It's silly. If I told my coworkers their opinions were "perverse," I wouldn't have coworkers anymore. > On May 28, 11:29 am, Jeff Schwab wrote: >> Rick DeNatale wrote: >>> On Thu, May 28, 2009 at 10:17 AM, Jeff Schwab wrote: Phlip wrote: > Railsters: > I heard a rumor that the incorrect answer, "Controller", was in > circulation out > there. That's how I was taught MVC, long before I'd heard of Ruby: Models do some basic checking, but business logic belongs in the controller. That was the point of the controller; it gave a central place to put business logic. >>> Well that's not the original intention of Trygve Reenskaug when he >>> conceived of MVC: >>> http://heim.ifi.uio.no/~trygver/1979/mvc-2/1979-12-MVC.pdf >> Thanks, I'll read that as soon as I have a chance. >> >>> Trygve's original goal was separating UI logic from domain logic (what >>> we commonly cause Business logic). The Model holds the domain >>> information and methods for processing it. >>> The View is concerned only with presenting the view to the user, a >>> model might have multiple views presenting different subsets and/or >>> projections of the model. >>> The Controller deals with communicating with the user, it processes >>> user input, and decides which views should be rendered and where. >> That's different from any form of MVC I've ever heard of, including >> Rails. Ordinarily, the views define the UI, and the Controller exists >> strictly behind the scenes, as implementation details. >> >>> So the Rails notion of MVC seems very similar to this 1979 version. >>> Controllers process user input and decide which view to render, Views >>> do the rendering, and Models do the heavy application lifting. >> That's not how Rails works. You're mostly right about the Models, but >> the controllers are, as Phlip suggested, just "patch boards," not for >> user input. Sometimes a savvy user can send HTTP requests to a Rails >> application without going through any view, but that's not the intent. >> >> One piece of "heavy lifting" still done by the controllers is access >> control; Models know how to answer questions, and don't intrinsically >> care who's asking. It's up to the Controllers to determine who gets to >> see what. >> >>> Subsequent variations of MVC, particularly those which piled >>> application logic into the controller are perversions of the original >>> idea. >> "Perversions." You know, there are ways of making a point that don't >> involve blanket insults of everyone who disagrees with you. >> >>> Note also that Reenskaug talks about Editors which are objects which >>> are associated with a view and are temporarily interposed between a >>> controller and a view. I think if you squint just a little bit you >>> can see the seeds of what Rails developers now refer to as a >>> Presenter. >> I'll have to look up Presenter. --~--~-~--~~~---~--~~ 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 rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: under MVC, business rules belong in the __________
Brian wrote: > > > On May 28, 11:29 am, Jeff Schwab wrote: >> That's not how Rails works. You're mostly right about the Models, but >> the controllers are, as Phlip suggested, just "patch boards," not for >> user input. Sometimes a savvy user can send HTTP requests to a Rails >> application without going through any view, but that's not the intent. >> > > > I'm new to both rails and MVC, so please correct me if I > misunderstand. But it seems that controllers DO handle user input for > the typical web application. A view helps a user format that input, > but it can't receive anything. In fact, I could just send an http > request to a rails application before ever interacting with UI. The > controller is what processes this request, consulting models if > necessary. The view isn't involved until the application tries to > send information back to me. You could, but you ordinarily don't. A user typically deals with a web page, entering information in (e.g.) a styled form. The controller only deals with "input" in the sense of HTTP requests, and it doesn't know whether they come directly from some hacker, or from an XMLHttpRequest object in some Ajax application. In such a case, btw, the Controller sends back XML directly, without going through the view; so, if we're going to take the stance that Controllers deal with input directly, then we also have to see them as providing output directly. It makes more sense, IMO, to see the View as defining the UI, and the Controller as an implementation detail. --~--~-~--~~~---~--~~ 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 rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] UserMailer return boolean value
Is it possible to make is UserMailer returns a boolean value depending on whether an email was sent or not? I have a method to send maybe I could put it in here somehow? def send_initial UserMailer.deliver_initial(self) end --~--~-~--~~~---~--~~ 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 rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Cross-Domain Data with Rack and Rails -- http://bit.ly/BNw6T
A big theme from RailsConf a few weeks ago was the arrival of Rack in Rails as of version 2.3. The first topic that seemed to pique developer interest was Rails Metal -- especially the speed bump of using a lighter stack for high volume URIs. While this is a useful upgrade to Rails, the architectural shift provided by Rack brings new flexibility. Read more about the value of mounting Rack middleware in your Rails stack: http://bit.ly/BNw6T --~--~-~--~~~---~--~~ 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 rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: how to set default path
First, rename the index.html file to something else. Then: map.root :controller => 'subject', :action => 'list' - Maurício Linhares http://alinhavado.wordpress.com/ (pt-br) | http://blog.codevader.com/ (en) On Thu, May 28, 2009 at 6:06 PM, Mk 27 wrote: > > Hi gang! > > I want / to point to app/subject/list instead of public/index.html. I > added this to routes.rb > > map.connect ':controller/:action/:id', :controller => 'subject', :action > => 'list' > > But that does not work... > -- > 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 rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] ActiveScaffold - undefined method `link' for #
Has anyone encountered this error message with the ActiveScaffold plugin? I'm working on Windows XP (yes) with Ruby 1.8.6 and Rails 2.3.2. I just created a new, fresh Rails application with a single model ("users"), installed the ActiveScaffold plugin, and followed the other two steps in the ActiveScaffold Getting Started tutorial. When I run the app, and browse to the resource (e.g. http://localhost:3000/users) I immediately see the following: NoMethodError in UsersController#index undefined method `link' for # Look familiar? What am I missing? I haven't done anything to the application except what was required by the tutorial. Am I the *only* developer trying this plugin under Windows? Many thanks for any pointers. Tim --~--~-~--~~~---~--~~ 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 rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] how to set default path
Hi gang! I want / to point to app/subject/list instead of public/index.html. I added this to routes.rb map.connect ':controller/:action/:id', :controller => 'subject', :action => 'list' But that does not work... -- 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 rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: migration issue
2009/5/27 Mk 27 > > Hassan Schroeder wrote: > > On Wed, May 27, 2009 at 7:34 AM, Mk 27 > > wrote: > > > >> because most sane people would want to preserve the contents of an > >> existing db when they modify it. > > > > Erm, so maybe the most appropriate ("sane") thing to do at that > > point would be to figure out *why* you're (apparently) repeating a > > migration that's already been done? > > There was an existing database, yes, I thought that was clear. The > reason I did it again was (also clear if you can read, but to repeat) > because I wanted to move the session store to Active Record so I was > following this instruction: > > > You need to create the session table as below > > rake db:sessions:create > > rake db:migrate > > Which I am grateful for that advice, because it worked; but I did have > to create the db manually (because I want it populated, and already have > a script to do that), add the session table myself (to the > aforementioned script), and insert it back in. So I guess I don't get > the point of the migration thing yet: is it more for people who don't > want to create a db themself, or what? > > Nb, this is my second casual week using rails. If all I want to do is > add a table to the database, why would it want to rebuild the whole > thing, ie, why not just add the new table and leave the existing tables > alone? I presume there is away to do this and I haven't read enough of > the API docs yet. You have hit the nail on the head here, that is exactly what migrations will do for you (ie "add the new table and leave the existing tables alone") in addition to other things of course. Colin > Is this going against "the convention", hence I > needed to do some more "configuration"? > > -- > 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 rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] I need a lot of advice here - let's start from the beginning
Hi Everyone, I'll try to make my opening summary as short as possible. I work as a hobbyist in web development (using Dreamweaver CS4, Photoshop CS4, PHP, Swishmax2(flash)). My dominant sites are all on "linux/unix" boxes but I program on a Windows Vista machine. I program for fun with C++, Autoit, Actionscript, and PHP for the most part. My background is that I've been in the IT industry for more than 16 years and I'm an extreme troubleshooter but I'm also a Windows System Administrator. That basically means I'm a jack of all trades where windows is concerned because I've seen a lot of things over the years as I dabble a lot. I have a photographic memory with a logical foundation set within. Therefore, I learn a lot faster than most people because I can retain information like a sponge to water. I have a lot of time available (in-between job searches right now) so I decided to spend my time wisely. About one week ago, I decided to push into Ruby with the idea that I'll eventually get into Ruby on Rails. I've researched it and it's the route I want to go. Anyhoo, I do not use linux and am not very familiar with linux. Some folks say it's not hard to use Ruby on windows and it's come a long way so I started pulling in some research materials. Here's what I've accomplished in one week so far: I read my first ruby book (Beginning Ruby - From Novice to Professional) by Peter Cooper. I installed Ruby using the one-click-installer I learned how to install and use gems. I learned the difficulty with installing gems that needed --platform=mswin32 I created my first program from scratch (an html parser I called scraper.rb) which pulls statistics off a website and stores it in yaml. I was instantly thrilled with the concept of classes, methods, even happy with how interpolation worked with variables. I thought to myself this is going to be great! I can design a class based app that can become modular as I build it and not suffer through past programming experiences. I was just about to get into RoR when I thought to myself it might be better to go with the latest ruby. So, I managed to upgrade my ruby to 1.9.1. I ordered another book from O'Reilly which is supposed to help with transitions from 1.8 - 1.9. I found out there were a lot of issues upgrading, namely with how a lot of the gems I used to be able to use no longer worked. The biggest issues I face now are using mysql on windows and also that my DBs online are 5.1. Keep in mind the online DBs are in fact on a linux/unix box and not on a windows but I do my programming on a windows box. Make sense? I hope so. It's just a convenience for me because I'm more fluent with windows. However, now I cannot get mysql to work. I did work through a lot of websearches and found the best install fix for me was something like: gem install kwatch-mysql-ruby --platform=mswin32 --source=http://gems.github.com/ However, when I tried to install it, I get the following error: *** ERROR: can't find mysql client library. *** extconf.rb failed *** I use mysql 5.1 on my windows machine and use Wampserver as my original development server/platform. So, I'm a little frustrated but I know I can get through this. And, I don't want to give up on Ruby at all. So, my questions are as follows: 1. What would you recommend I do concerning developing on a windows box when my websites are located on linux/unix. Is it doable? Do I have to make a lot of adjustments? 2. If I had to go to linux to use RoR effectively, how steep is the learning curve going to be and what would I need to do to ensure that I can dual-boot on both vista and linux where appropriate? 3. What other suggestions can you give me to help improve my transition to ruby on rails (things that you might have encountered and learned from) 4. Is it worth it to stick with RoR as a native windows user or should I be thinking about something else. I apologize for the very long post but I needed to start with a wide audience to retrieve the best answers. Many thanks to any who read and respond accordingly. J.D. -- 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 rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: How to test that a specific error message is thrown
> Hope you find that useful > :) Thanks for the tip. I'm currently reading a book "Professional Webdevelopment with RoR2" by Jens-Christian Fischer and he's just getting into Rspec. I wasn't sure how indepth I should read that part, but now I will definitely take the time to check it out. -- 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 rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Why won't my ActionMailer work inside the controller?
I've got a basic mailer setup and am simply trying to get a Hello message through. If I go into script/console and execute Emailer.deliver_message("mys...@mydomain.com","My subject", "My message") it works fine. However, if I fire up a controller with a test method that invokes the same thing def test Emailer.deliver_message("mys...@mydomain.com","My subject", "My message") end I never see the message. Something obvious I'm missing in the context of running it in the controller? -- 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 rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: Newbie Help (No Method Error)
Perfect... It works now! Thank you for helping me out Philip -- 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 rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: Time.parse seems to fail
Ok, some more details: > it's seems to me the function Time.parse has an error: > > ok- Time.parse("12/01/2008") => 2008-12-01 > Error - Time.parse("01.12.2008") => 2008-01-12 > Time.parse("01.12.2008") => 2008-12-01 whould be correct. I found already the function _parse in lib/ruby/1.8/date/format.rb. But before I change in this file, must be really sure, there is no other solution. mfg -- 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 rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Apps for Democracy has $35,000 in Prizes for Ruby Devs
Hi all, We're running a development contest for the city of Washington DC call Apps for Democracy that has $35k up for grabs for the best community site that ties in the city's 311 system. Full info is here: http://www.appsfordemocracy.org We've got an open source code jam taking place at GW University on 6/6 that you can RSVP to here: http://opencodeapps09.eventbrite.com Good luck, and let me know if you have any questions. Peter http://twitter.com/corbett3000 --~--~-~--~~~---~--~~ 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 rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Rails collection_select syntax issue
I'm trying to display unique counties listed in my database in select box for a property database. I've figured out how to do this, but now I can't figure out how to access the selected value of the select. This mainly has do with the way the HTML select name is outputted. My form code, county is an attribute for my property model: <%= collection_select(:property, :county, @Counties, :county, :county, {:prompt => true}) %> This outputs the HTML Please select Pearl River Marion Stone Lamar Forrest Jones Washington It is the []'s in the select name "property[county] that is giving me fits. The other items in the search form use select_tag so the output is simply "min_price" rather than "property[min_price]". This is causing a syntax error when I'm trying to put together my search results array in my Property model: def self.find_by_lcc(params) where = [] unless params[:mls].blank? where << "mls = :mls" end unless params[:county].blank? where << "county = :county" end unless params[:min_acreage].blank? where << "acreage >= :min_acreage" end unless params[:max_acreage].blank? where << "acreage <= :max_acreage" end unless params[:min_price].blank? where << "price >= :min_price" end unless params[:max_price].blank? where << "price <= :max_price" end if where.empty? [] else find(:all, :conditions => [where.join(" AND "), params], :order => "city, price desc") end Due to the county problem all the records are being listed rather than just the properties within that county. The browser URL string I'm getting is: public/land?mls=&property[county] =Stone&min_acreage=0&max_acreage=1600&min_price=0&max_price=160&commit=Search I have searched for answers on this for a couple of days and I'm sure it's a simple syntax method I need to use in compiling my search array. Thanks for any help! --~--~-~--~~~---~--~~ 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 rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Time.parse seems to fail
Hi, it's seems to me the function Time.parse has an error: ok- Time.parse("12/01/2008") => 2008-12-01 Error - Time.parse("01.12.2008") => 2008-01-12 Or is there an option/timezone I have to chnage, so it will work correctly? Greetings Claus-Christian Ude -- 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 rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: Newbie Help (No Method Error)
On May 28, 2009, at 11:45 AM, Michael Michael wrote: > > I am following the “Agile Web Development with Rails” and I have > decided > to deviate from the book a bit to discover Rails plugins. > > I have set up my app to use “paperclip” to size my photos. I have > managed to get the app working on part of my application. > > But...Im getting this error. > > NoMethodError in Store#index > You have a nil object when you didn't expect it! > The error occurred while evaluating nil.photo > > Extracted source (around line #5): > > This is my code: > > New Products on Display > > > > <% for product in @products -%> > > > ><%= image_tag @product.photo.url ( :small) %> @product should be product without the @. > < (error here) ><%=h product.title %> > ><%= product.description %> > > > ><%= number_to_currency(product.price) %> > ><%= button_to "Add to Cart" %> > > > > > > <% end %> > > > This is my first post: Let me know if you guys need more information. > Thanks for the 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 email to rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: Getting values from multiple select
Pål Bergström wrote: > Freddy Andersen wrote: > --- > - - !binary | > xGdn > > This tells me that it also worked with "select". Maybe better to ask; is anyone using multiple select in Rails? How does it work? -- 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 rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: Java kicks Rails's butt - it says right here!
I couldn't have said it better than Robert. On May 27, 11:11 am, Robert Walker wrote: > Phlip wrote: > >http://java.sys-con.com/node/965189 > > > I am certainly going back to Java, just as soon as I figure out how to > > configure > > Tomcat. > > > Until then, anyone care to take on this logic? Has anyone here used Java > > the way > > they say they should? > > Here is my biggest problem with the entire article: > > "Model Driven Framework" > > My day job is as a Java developer, and I can testify that this is the > line of thinking of most Java developers I know. In my opinion "Model > Driven" design is exactly upside-down. End users don't care one bit > about how beautiful, or elegant, your model code is. They don't want to > see a user interface that exposes the design of the model. > > What users care about is the experience. The interface that allows them > to accomplish whatever task is at hand. If that means pulling data from > 20 different model objects and mashing them together on a single page, > then so be it. The tools the developers use must be able to support > whatever presentation makes sense for the end user, not for themselves > to make development life easy. > > This is a line of thinking that Ruby on Rails confirmed for me as a > developer. > > http://gettingreal.37signals.com/ch09_Interface_First.php > -- > Posted viahttp://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 rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: Getting values from multiple select
Freddy Andersen wrote: > Is this in a form_for? if not you should use select_tag > > http://apidock.com/rails/ActionView/Helpers/FormTagHelper/select_tag > > What do you have in @options? > > This is the select method > select(object, method, choices, options = {}, html_options = {}) > > Examples here > http://apidock.com/rails/ActionView/Helpers/FormOptionsHelper/select > > To debug these issues you should have a look at the compiled source > with view source in the browser and see what you got. I'm back to start. I got --- - - !binary | xGdn This tells me that it also worked with "select". -- 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 rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: under MVC, business rules belong in the __________
On May 28, 11:29 am, Jeff Schwab wrote: > That's not how Rails works. You're mostly right about the Models, but > the controllers are, as Phlip suggested, just "patch boards," not for > user input. Sometimes a savvy user can send HTTP requests to a Rails > application without going through any view, but that's not the intent. > I'm new to both rails and MVC, so please correct me if I misunderstand. But it seems that controllers DO handle user input for the typical web application. A view helps a user format that input, but it can't receive anything. In fact, I could just send an http request to a rails application before ever interacting with UI. The controller is what processes this request, consulting models if necessary. The view isn't involved until the application tries to send information back to 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-talk@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] rake db:create, db:migrate ok but rake RAILS_ENV=production db:create, db:migrate fails...
Hello, anybody have any clue why the following is happening: if i do "rake db:drop, rake db:create, rake db:migrate" everything is fine but if i do "rake RAILS_ENV=testing db:drop", then "rake RAILS_ENV=testing db:create" & then "rake RAILS_ENV=testing db:migrate" it fails on the migrate part, i get "Validation Failed: Group has already been taken" in the middle of the migration --~--~-~--~~~---~--~~ 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 rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: turn off model pre-loading in production environment?
Ok i was able to run the production env as development by changing stuff in config/environments/testing.rb so its ok now On May 28, 10:25 am, Kentor wrote: > In the dev env, when i go to the localhost from the browser (i use > testing.site.com, i changed the hosts settings), first the weborb code > is loaded and then the code in the models is loaded. But in the > production env it is the other way around, when i go to > testing.theprodsite.com, first the model files are pre-loaded and then > the controllers are loaded but i need to use the request function > available only in the controller and i need the function before the > models are loaded... lemme know if its still unclear. Thanks! > > On May 28, 10:04 am, Freddy Andersen wrote: > > > Preloadthecontroller? Could you please give an example --~--~-~--~~~---~--~~ 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 rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: Getting values from multiple select
Freddy Andersen wrote: > Is this in a form_for? if not you should use select_tag > > http://apidock.com/rails/ActionView/Helpers/FormTagHelper/select_tag > > What do you have in @options? > > This is the select method > select(object, method, choices, options = {}, html_options = {}) > > Examples here > http://apidock.com/rails/ActionView/Helpers/FormOptionsHelper/select > > To debug these issues you should have a look at the compiled source > with view source in the browser and see what you got. That helped. But I only get the first value. Even if I use "items[]". -- 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 rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Newbie Help (No Method Error)
I am following the “Agile Web Development with Rails” and I have decided to deviate from the book a bit to discover Rails plugins. I have set up my app to use “paperclip” to size my photos. I have managed to get the app working on part of my application. But...Im getting this error. NoMethodError in Store#index You have a nil object when you didn't expect it! The error occurred while evaluating nil.photo Extracted source (around line #5): This is my code: New Products on Display <% for product in @products -%> <%= image_tag @product.photo.url ( :small) %> < (error here) <%=h product.title %> <%= product.description %> <%= number_to_currency(product.price) %> <%= button_to "Add to Cart" %> <% end %> This is my first post: Let me know if you guys need more information. Thanks for the 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 email to rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: plz help to correct my query
On May 28, 10:14 am, Venkat Eee wrote: > Hi, > > I want to display both terminal_id and user_id. If i try to echo by > using p i.e > p @list > It is displaying only terminal_id. Please help me to correct my query. > You're going to have to do that your self - output foo.user_id and foo.terminal_id for each foo in your list. Fred > @list = NetworkTerminal.find(:all, > :select => "network_terminals.terminal_id,timings.user_id", > :joins => "LEFT JOIN timings ON network_terminals.terminal_id = > timings.terminal_id", > :conditions => {:network_id => 'net343'} > ) > > Thanks, > -- > Posted viahttp://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 rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Altering text field value on form load
Suppose I have a model, 'Associate', and it has a string member, 'branch'. Sometimes branch can end with a percent sign (%) and sometimes not. I have a form to display the Associate data. In the branch field, I am simply putting whatever text is in branch, before (to the left of) the input box. In the input box itself, I either want to show the % sign if branch ends in %, or, nothing. How can I specify this? Below is my stab at it -- SUppose the branch is '34%' , Of course, the way I have it, what shows in the text box is the full branch of 34%, wherein, in this case, it should just be %. <% form_for @associate do |f| %> <%= f.label @associate.branch.split("%") %><%= f.text_field :branch %> <% end %> (In my model, I have a before_save. which will set branch to that original portion of branch left of the %, plus whatever is in the text box. In so doing, no one can ever bring themselves up the branch- coding tree, see?) -JannaB --~--~-~--~~~---~--~~ 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 rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: Know what was updated
> That's a great point Philip. I'm actually trying to solve that very > problem in a project I'm working on. > > I want to be able to do exactly what lighthouseapp does when it logs > ticket updates. In that case, you have comments that people can make > on a ticket. But when someone updates the ticket, I want to create a > comment and log who changed what. I've now learned you can't do that > with a simple model observer (because I need to know who is updating > the ticket, which is part of the session). > > I searched around on this list and the only thing I've found with any > substance is people recommending the cache sweeping recipe from the > book rails recipes. I'm digging into that now > > In your case though, you're creating a separate model (AuditLog) in > the controller...I want to keep this out of the controller. > > Do you have any experience with cache sweeping for this purpose? Honestly it was long enough back I don't remember :) It might have been that I didn't want to log all updates, only at certain times that had me keep it out of any cache/observers... --~--~-~--~~~---~--~~ 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 rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: ActiveResource as API test rig? Two jsons?
bump... On Wed, May 20, 2009 at 3:57 PM, Marc Byrd wrote: > Hi, > > I'm using ActiveResource as an API test rig for an API we're developing for > our PHP app - the goal being to validate that we're following some > externally validated conventions for ReSTful API and that we can support at > least one external framework. ;^) I'm open to opinions on the wisdom of > this approach. > > Meanwhile, I'm getting some strange behavior when running from command line > vs. running w/in rails: > > First, from command line: > require 'rubygems' > require 'activesupport' > require 'activeresource' > > class Channel < ActiveResource::Base > self.site = "http://192.168.1.101/"; > self.format = :json > end > > c = Channel.find(:all , :params => {:owner => "iamwill"}) > > Result is: > /var/lib/gems/1.8/gems/activesupport-2.3.2/lib/active_support/json/decoding.rb:14:in > `decode': Invalid JSON string (ActiveSupport::JSON::ParseError) > from > /var/lib/gems/1.8/gems/activeresource-2.3.2/lib/active_resource/formats/json_format.rb:19:in > `decode' > from > /var/lib/gems/1.8/gems/activeresource-2.3.2/lib/active_resource/connection.rb:116:in > `get' > from > /var/lib/gems/1.8/gems/activeresource-2.3.2/lib/active_resource/base.rb:576:in > `find_every' > from > /var/lib/gems/1.8/gems/activeresource-2.3.2/lib/active_resource/base.rb:519:in > `find' > from channels.rb:10 > > But when I run from rails, it parses no problem. > > I gave the rails version malformed json to cause it to choke to figure out > the difference: > > vendor/rails/activesupport/lib/active_support/json/decoding.rb:14:in `decode' > > > Is it possible to coerce the non-rails version to use the rails json > parser? Why are there two different versions? > > Thanks, > > > m > > > > > --~--~-~--~~~---~--~~ 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 rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Status: 500 Internal Server Error when starting ruby applica
I am trying to run an Ruby on Rails application developed internally. Any input would be greatly appreciated… When I start the server I get the following warning: [shajiza...@worf script]$ ./server => Booting WEBrick => Rails 2.3.2 application starting on http://0.0.0.0:3000 => Call with -d to detach => Ctrl-C to shutdown server [2009-05-28 18:29:41] INFO WEBrick 1.3.1 [2009-05-28 18:29:41] INFO ruby 1.8.7 (2008-08-11) [i686-linux] [2009-05-28 18:29:46] WARN TCPServer Error: Address already in use - bind(2) [2009-05-28 18:29:46] INFO WEBrick::HTTPServer#start: pid=4587 port=3000 I have checked that there is no other application using port 3000 With lsof | grep 3000 I have tried to start the WEBrick on a different port and get the same warning: [shajiza...@worf script]$ ./server -p 3001 => Booting WEBrick => Rails 2.3.2 application starting on http://0.0.0.0:3001 => Call with -d to detach => Ctrl-C to shutdown server [2009-05-28 19:12:34] INFO WEBrick 1.3.1 [2009-05-28 19:12:34] INFO ruby 1.8.7 (2008-08-11) [i686-linux] [2009-05-28 19:12:39] WARN TCPServer Error: Address already in use - bind(2) [2009-05-28 19:12:39] INFO WEBrick::HTTPServer#start: pid=4805 port=3001 When I try to access the application through the firefox browser I get the following error and trace: SQL (0.2ms) SET NAMES 'utf8' SQL (0.1ms) SET SQL_AUTO_IS_NULL=0 /!\ FAILSAFE /!\ Thu May 28 19:15:14 -0700 2009 Status: 500 Internal Server Error no such file to load -- lib/zmags/zmags /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require' /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require' /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:156:in `require' /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:521:in `new_constants_in' /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:156:in `require' /home/shajizaidi/e-mangue/app/controllers/application_controller.rb:5 /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:380:in `load_without_new_constant_marking' /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:380:in `load_file' /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:521:in `new_constants_in' /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:379:in `load_file' /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:259:in `require_or_load' /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:425:in `load_missing_constant' /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:80:in `const_missing' /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:92:in `const_missing' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/dispatcher.rb:90:in `dispatch' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/dispatcher.rb:111:in `_call' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/dispatcher.rb:82:in `initialize' /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/query_cache.rb:29:in `call' /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/query_cache.rb:29:in `call' /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/abstract/query_cache.rb:34:in `cache' /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/query_cache.rb:9:in `cache' /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/query_cache.rb:28:in `call' /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:361:in `call' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/vendor/rack-1.0/rack/head.rb:9:in `call' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/vendor/rack-1.0/rack/methodoverride.rb:24:in `call' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/params_parser.rb:15:in `call' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/rewindable_input.rb:25:in `call' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/session/cookie_store.rb:93:in `call' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/reloader.rb:9:in `call' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/failsafe.rb:11:in `call' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/vendor/rack-1.0/rack/lock.rb:11:in `call' /usr/local/lib/rub
[Rails] Re: Rails application without database
Roderick van Domburg wrote: [...] >> With this requirement can I somehow package the entire application as a >> single exe on windows so that users can install with ease? > > I haven't tried yet, but you should be able to. You might try > http://www.erikveen.dds.nl/rubyscript2exe/ or apps such as Joyent > Slingshot or Google Gears. > I haven't done this either, but I would guess that it might also be worth investigating the idea of using JRuby to package the whole thing as a Java app. That would also mean that you could run it on any OS! > -- > Roderick van Domburg > http://www.nedforce.com Best, -- Marnen Laibow-Koser http://www.marnen.org mar...@marnen.org -- 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 rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: how to create dependent record automatically
> Perhaps if you give us a little more information on A and B, their > attributes etc., I can offer a little more advice? > Well, what I am trying to achieve here is that no way two records are created in B such that they belong to same record in A. For clear explanation let me try to map the problem in more realistic way. Let's say A => Student {roll_no} B => Marksheet ( maths, science, sst, student_id ) Now every student has only one marksheet. I want to make sure that for every student only one mark sheet is created. For this I have maintained a relationship of 1:1 between STudent:Marksheet. Marksheet blongs_to Student and Student has_one marksheet. Marksheet also has a field student_id. And <<<>.>>will ensure that no two records are created in a normal situation. But I am concerned of a rare possibility when through two different sessions same user is trying to create two marksheets. Based on my understanding in such cases, this validation might allow to create two records with the same "stident_id" if in both the sessions database is fetched when no record was saved. My approach was to not even to let the user create the record in Marksheet/ As soon as a Student record is created, I add the Marksheet record as well. Now I can create and save marksheet record in normal case but if Marksheet record has validations for NIL fields ( to be left NIL initially for subject fields ) will fail the validation. Is it the situation where "locks" are used ?? vipin --~--~-~--~~~---~--~~ 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 rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: Use callbacks to determine model field changes?
Thanks for the help guys. However, I've now hit the trap where I need session data in the observer (who is changing the model)... --~--~-~--~~~---~--~~ 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 rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: under MVC, business rules belong in the __________
I didn't read it as an insult...according to the dictionary: 'perversions: a perverted form of something' 'perverted: turned from what is right; misguided; distorted.' Then every MVC implementation that differs from the original is indeed 'distorted' and therefore 'perverted' Do we really need to try and interpret everything as flamebait? On May 28, 11:29 am, Jeff Schwab wrote: > Rick DeNatale wrote: > > On Thu, May 28, 2009 at 10:17 AM, Jeff Schwab wrote: > >> Phlip wrote: > >>> Railsters: > > >>> I heard a rumor that the incorrect answer, "Controller", was in > >>> circulation out > >>> there. > >> That's how I was taught MVC, long before I'd heard of Ruby: Models do > >> some basic checking, but business logic belongs in the controller. That > >> was the point of the controller; it gave a central place to put business > >> logic. > > > Well that's not the original intention of Trygve Reenskaug when he > > conceived of MVC: > > > http://heim.ifi.uio.no/~trygver/1979/mvc-2/1979-12-MVC.pdf > > Thanks, I'll read that as soon as I have a chance. > > > Trygve's original goal was separating UI logic from domain logic (what > > we commonly cause Business logic). The Model holds the domain > > information and methods for processing it. > > > The View is concerned only with presenting the view to the user, a > > model might have multiple views presenting different subsets and/or > > projections of the model. > > > The Controller deals with communicating with the user, it processes > > user input, and decides which views should be rendered and where. > > That's different from any form of MVC I've ever heard of, including > Rails. Ordinarily, the views define the UI, and the Controller exists > strictly behind the scenes, as implementation details. > > > So the Rails notion of MVC seems very similar to this 1979 version. > > Controllers process user input and decide which view to render, Views > > do the rendering, and Models do the heavy application lifting. > > That's not how Rails works. You're mostly right about the Models, but > the controllers are, as Phlip suggested, just "patch boards," not for > user input. Sometimes a savvy user can send HTTP requests to a Rails > application without going through any view, but that's not the intent. > > One piece of "heavy lifting" still done by the controllers is access > control; Models know how to answer questions, and don't intrinsically > care who's asking. It's up to the Controllers to determine who gets to > see what. > > > Subsequent variations of MVC, particularly those which piled > > application logic into the controller are perversions of the original > > idea. > > "Perversions." You know, there are ways of making a point that don't > involve blanket insults of everyone who disagrees with you. > > > Note also that Reenskaug talks about Editors which are objects which > > are associated with a view and are temporarily interposed between a > > controller and a view. I think if you squint just a little bit you > > can see the seeds of what Rails developers now refer to as a > > Presenter. > > I'll have to look up Presenter. --~--~-~--~~~---~--~~ 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 rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: How to test that a specific error message is thrown
I'd also recommend checking out rspec. It's a BDD framework that helps you write tests that feel a lot more intuitive than the default rails testing suite. simply install the rspec gem and the rspec-rails gem Specs are written like: describe User do it "should not be valid without a name" do user = User.new user.valid? user.errors.on(:name).should == "can't be blank" end end Hope you find that useful :) --~--~-~--~~~---~--~~ 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 rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: Know what was updated
That's a great point Philip. I'm actually trying to solve that very problem in a project I'm working on. I want to be able to do exactly what lighthouseapp does when it logs ticket updates. In that case, you have comments that people can make on a ticket. But when someone updates the ticket, I want to create a comment and log who changed what. I've now learned you can't do that with a simple model observer (because I need to know who is updating the ticket, which is part of the session). I searched around on this list and the only thing I've found with any substance is people recommending the cache sweeping recipe from the book rails recipes. I'm digging into that now In your case though, you're creating a separate model (AuditLog) in the controller...I want to keep this out of the controller. Do you have any experience with cache sweeping for this purpose? --~--~-~--~~~---~--~~ 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 rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Autocomplete Plugin - how can I use same "text_field_with_auto_complete" twice on one page?
I'm trying to use an autocomplete twice on the same page, but only the first one renders and functions. I'm using the Autocomplete Plugin and Rails 2.1 Thanks, Andy --~--~-~--~~~---~--~~ 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 rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: How to test that a specific error message is thrown
> Here's an article about BDD if you're interested: > http://dannorth.net/introducing-bdd Hey, cool article. Thanks a lot. I will read that through this evening. I'm still a bit new to TDD and am still finding my way around, so thanks for the advice. -- 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 rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] i18n and count question
Hi. What is the proper way to handle situations where you need pluralization with and without adding the count? The best I could think of is to write it twice: item: one: 'item' other: 'items' c_item: one: 'one item' other: '{{count}} items' It's not very DRY. I guess there should be a better way of doing. How do you handle this situation? -- M. --~--~-~--~~~---~--~~ 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 rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: plz help to correct my query
Venkat Eee wrote: > Hi, > > I want to display both terminal_id and user_id. [...] Where is user_id supposed to come from? It's not clear from looking at your query. Best, -- Marnen Laibow-Koser http://www.marnen.org mar...@marnen.org -- 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 rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: 500,000 to 1million records a day. Can Rails scale to that?
> I'd agree with you. And it will come as no surprise to those who've > seen other posts of mine that I'd *strongly* recommend PostgreSQL rather > than mySQL. Or you can use MySQL instead of that mySQL, should work just fine. Regards, Rimantas -- http://rimantas.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 rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: how to create contact ( tableless ) page in RESTful Rails
Any Luck Saviours! On May 28, 9:43 pm, gokul murthy wrote: > Hello to all, > how to create contact ( tableless ) page in RESTful Rails ?? > please send me any links or code snippets to work on this. > Thanks in Advance > Rails Thinker --~--~-~--~~~---~--~~ 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 rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: 500,000 to 1million records a day. Can Rails scale to that?
Philip Hallstrom wrote: > I realize I'm about to open a can of worms, but I'd be more concerned > about mysql than I would about rails. InnoDB and all that sort of > stuff being set up properly to handle the number of inserts, etc... > you'd have the same issue with PHP... I'd agree with you. And it will come as no surprise to those who've seen other posts of mine that I'd *strongly* recommend PostgreSQL rather than mySQL. It does a better job at maintaining speed and referential integrity at the same time, and has a whole host of other advantages that will probably make life easier with large datasets. Best, -- Marnen Laibow-Koser http://www.marnen.org mar...@marnen.org -- 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 rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: how to show dropdown list with selected value?
im fairly new to Ruby On Rails, but I had to do this and here how I did it. in my subscriber controller: def edit @subscriber = Subscriber.find(params[:id]) @offer = Offer.find(@subscriber.offer) @offers = Offer.find(:all) end In my edit view: Offer: <% @offers.each do |offer| %> <% if @offer==offer %> <%= offer.name %> <% else %> <%= offer.name %> <%end%> <% end %> It may be not the most efficient way since Im fairly new to RoR or to web programming in general. I just did a if.else checking when in the list of offers I get the subscriber.offer and added a "selected" a little bit like your were trying to do On May 28, 10:09 am, Mike75 wrote: > well.. > Litwin, i've tried it.. > and it shows the drop down list.. > but not with the saved data in the selected option, instead, it shows > the default value, the one on top of the list. > > it supposed to work just like that? > is there something i've done wrong, then? > > On May 28, 1:11 am, "E. Litwin" wrote: > > > Have you tried using the same collection_select statement on the edit > > page? It works for me. > > > On May 27, 6:24 am, Mike75 wrote: > > > > hi.. > > > I'm having a problem with an editing view to show a dropdown list > > > withselectedvalue. > > > > my tables are as followed > > > product table : id | Name | Price | Country_id > > > country table : id | CountryName > > > > on the product new.htm.erb, I've got the list like this > > > <%= collection_select ("product", "Country_id", > > > @country, :id, :CountryName) %> > > > and it generates html tags and saves good too. > > > > now, I'd like to edit the product on the edit.html.erb with the same > > > dropdown list with > > > collected product.Country_id. > > > > CountryName > > > > anyone knows how to to this? I've tried the rails.api way of doing > > > it.. such as > > > > select(:product, :Country_id, country.find(:all).collect {|c| > > > [ c.CountryName, c.id ] }, {:include_blank => 'None'}) > > > and it didn't work.. --~--~-~--~~~---~--~~ 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 rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: how to show dropdown list with selected value?
Here is a snippet of the code from one of my projects. This same code is in both my new and edit forms. <% form_for(@field) do |f| %> ... <%= f.label :lookup_category_id %> <%= @lookup_categories = LookupCategory.find(:all, :order => "lookup_category_name") f.collection_select(:lookup_category_id, @lookup_categories, :id, :lookup_category_name, :prompt=>"Select a Lookup category (optional)") %> ... <% end %> On May 28, 7:09 am, Mike75 wrote: > well.. > Litwin, i've tried it.. > and it shows the drop down list.. > but not with the saved data in the selected option, instead, it shows > the default value, the one on top of the list. > > it supposed to work just like that? > is there something i've done wrong, then? > > On May 28, 1:11 am, "E. Litwin" wrote: > > > Have you tried using the same collection_select statement on the edit > > page? It works for me. > > > On May 27, 6:24 am, Mike75 wrote: > > > > hi.. > > > I'm having a problem with an editing view to show a dropdown list > > > withselectedvalue. > > > > my tables are as followed > > > product table : id | Name | Price | Country_id > > > country table : id | CountryName > > > > on the product new.htm.erb, I've got the list like this > > > <%= collection_select ("product", "Country_id", > > > @country, :id, :CountryName) %> > > > and it generates html tags and saves good too. > > > > now, I'd like to edit the product on the edit.html.erb with the same > > > dropdown list with > > > collected product.Country_id. > > > > CountryName > > > > anyone knows how to to this? I've tried the rails.api way of doing > > > it.. such as > > > > select(:product, :Country_id, country.find(:all).collect {|c| > > > [ c.CountryName, c.id ] }, {:include_blank => 'None'}) > > > and it didn't work.. --~--~-~--~~~---~--~~ 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 rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: 500,000 to 1million records a day. Can Rails scale to that?
On May 28, 5:41 pm, Philip Hallstrom wrote: > > We are planning to use rails+mysql to develop a website that sells > > Lotto > > Tickets. We expect 500,000 to 1 million(/8 hours) tickets sold a day. > > Each records should be 100 bytes long only. > > > And we also need to use SSL+Transaction Support. > > > The big question is Can Rails support that amount of traffic? Or I > > better consider PHP? > > I realize I'm about to open a can of worms, but I'd be more concerned > about mysql than I would about rails. InnoDB and all that sort of > stuff being set up properly to handle the number of inserts, etc... > you'd have the same issue with PHP... Yeah, worry about the database. If your ruby (or php or java etc.) code is the bottleneck, just get more frontends and reconfigure the load balancer, if the db is what's limiting you then things are harder. Fred --~--~-~--~~~---~--~~ 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 rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: Nice way to set attributes to nil if blank
Philip Hallstrom wrote: >> BTW, this seems like the sort of behaviour that one might want to have >> quite often in a model, to prevent form submission from changing 'nil' >> to "". Maybe i'll put it into a macro, i'll post up my code here if i >> do. > > I don't recall the name, but there is a plugin on > agilewebdevelopment.com/plugins that does this automatically. > > This may have been it... looks like it will do what you want in any > case. > > http://agilewebdevelopment.com/plugins/stripattributes > > -philip Nice - thanks for that philip! -- 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 rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: shorten a link
Yeah, URI is the library to work with. You could tighten it up and just do: homepage = URI.parse("http://www.nyt.com/sports/lakers/123/";).host On the model, you could put "require 'uri' " but I think its loaded with Rails by default. --Tom I don't think On May 28, 12:19 pm, Sean Six wrote: > tomrossi7 wrote: > > Sean, > > > Are you saving this url to the model? I'm not sure what you mean by > > shorten it up? > > > --Tom > > I want a user to submit a link to a webpage. After they submit the link > I want to parse it to the homepage url. Like if the article > iswww.nyt.com/sports/lakers/123. I want to have this shortened to the > homepage link nyt.com. You can try it in the interpreter as someone > posted above. > > -- > Posted viahttp://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 rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: Know what was updated
On May 28, 2009, at 8:13 AM, JL Smith wrote: > > First, get familiar with model callbacks if you're not already because > you don't want to put this logic in the controller: You might... the problem with the callbacks is you don't get access to the user who did it (depending on how they've logged in), nor can you ignore any trivial changes -- although that might not be a requirement here... Below was my solution for selectively logging actions... http://pjkh.com/articles/2009/02/02/creating-an-audit-log-in-rails -philip --~--~-~--~~~---~--~~ 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 rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] how to create contact ( tableless ) page in RESTful Rails
Hello to all, how to create contact ( tableless ) page in RESTful Rails ?? please send me any links or code snippets to work on this. Thanks in Advance Rails Thinker --~--~-~--~~~---~--~~ 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 rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: 500,000 to 1million records a day. Can Rails scale to that?
> We are planning to use rails+mysql to develop a website that sells > Lotto > Tickets. We expect 500,000 to 1 million(/8 hours) tickets sold a day. > Each records should be 100 bytes long only. > > And we also need to use SSL+Transaction Support. > > The big question is Can Rails support that amount of traffic? Or I > better consider PHP? I realize I'm about to open a can of worms, but I'd be more concerned about mysql than I would about rails. InnoDB and all that sort of stuff being set up properly to handle the number of inserts, etc... you'd have the same issue with PHP... --~--~-~--~~~---~--~~ 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 rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: Nice way to set attributes to nil if blank
> BTW, this seems like the sort of behaviour that one might want to have > quite often in a model, to prevent form submission from changing 'nil' > to "". Maybe i'll put it into a macro, i'll post up my code here if i > do. I don't recall the name, but there is a plugin on agilewebdevelopment.com/plugins that does this automatically. This may have been it... looks like it will do what you want in any case. http://agilewebdevelopment.com/plugins/stripattributes -philip --~--~-~--~~~---~--~~ 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 rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: Resource routes with further options
map.resources :queries, :member => {:myfunction => :get} should do just fine, additional parameters don't affect the routing In my app I have: map.resources :cdocs, :member => {:linkable => :get} for one resource, and the linkable invocations take additional parameters. Remember parameters come after the ? and don't affect the routing. -- 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 rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: shorten a link
tomrossi7 wrote: > Sean, > > Are you saving this url to the model? I'm not sure what you mean by > shorten it up? > > --Tom I want a user to submit a link to a webpage. After they submit the link I want to parse it to the homepage url. Like if the article is www.nyt.com/sports/lakers/123. I want to have this shortened to the homepage link nyt.com. You can try it in the interpreter as someone posted above. -- 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 rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: How to test that a specific error message is thrown
You're welcome. Just a little advice - It's generally better practice to be more specific with the names of your tests. I find it helps define exactly what it is you're testing for. Here's an article about BDD if you're interested: http://dannorth.net/introducing-bdd --~--~-~--~~~---~--~~ 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 rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: How to test that a specific error message is thrown
Hi, That worked perfectly. Thank you very much. -- 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 rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: How to test that a specific error message is thrown
Yep try... def test_should_not_be_valid_without_name user = User.new user.valid? assert_equal user.errors.on(:name), "Please enter a name" end --~--~-~--~~~---~--~~ 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 rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: confused on how rails 2.3.2 renders templates
I think I figured out what was going on. When I had a file named "something.html.erb.save" in the view directory, rails 2.3.2 for some strange reason decided to render that template instead of "something.html.erb". When I deleted "something.html.erb.save" then rails 2.3.2 looked for "something.erb" which did not exist, though something.html.erb" did exist. When I restarted web brick however after deleting "something.html.erb.save", then it did find "something.html.erb" ok. So Rails was keeping state info when the server was running On May 28, 11:53 am, Conrad Taylor wrote: > On Thu, May 28, 2009 at 8:51 AM, wbsurf...@yahoo.com > wrote: > > > > > I am migrating to rails 2.3.2 > > > What I found confusing is that in some cases when I have a template > > named: > > > "something.html.erb" it is looking for "something.erb", but in other > > cases "something.html.erb" works fine. > > I looked at a couple of cases and did not see any obvious reason why > > that seemed to be the case where it was looking for one type of file > > name in one place and a different in another. > > Please post the relevant code that's requesting something.erb so that > we can better assist. > > -Conrad --~--~-~--~~~---~--~~ 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 rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---