[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] 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] 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' internal:prelude: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' internal:prelude: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] Re: strange behaviour in ActiveRecord transaction
Perhaps some validation fails on self. Try save! To raise an exception 2009/5/28, Sandworth Meb rails-mailing-l...@andreas-s.net: and MySQL 5.0 -- Posted via http://www.ruby-forum.com/. -- Von meinen Mobilgerät aus gesendet --~--~-~--~~~---~--~~ 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: legacy db connection
Try with :class_name option in has_many method. has_many :freak_items, :foreign_key = projectId, :class_name = Freak_Item -- 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] import unicode characters
Hi , i have a problem while importing unicode characters (üşçö etc). i have scaffold categories model then i try create new categorie using CRUD scenario so it worked , but when i use csv_import controller , characters dont seems right. how can i solve this problem --~--~-~--~~~---~--~~ 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: import unicode characters
I've discovered the same thing as Peter, although I'm using different tools (Upscene's Database Workbench Pro 2.8.10) to import the data from both MDB and Firebird tables, which both handle the unicode (DBCS) character set acceptably well. Having said that, I've also tried command-line importing from native and delimited text versions of my source data, and I get exactly the same errors as I see in DBW. e.g. : Incorrect string value: 'Agnetha F\xE4ltskog' for column 'artistname' at row 1 I'm using MySQL V5.0.45 x64. I've tried every different combination of character set for the columns in the destination MySQL table, and neither single nor double-byte characters seem to be imported properly. I've also tried using different table types (InnoDB and MySAM) to see if that makes any difference. It doesn't appear to (i.e. I get the same errors at the same point in the imported data). I do understand that there are some limitations in using unicode (or unicode-like) character sets, but I'm banging my brains out trying to not have to hand-edit or perform on-the-fly mappings of a couple of characters in a couple of columns in ~1200 records of a 7,000 record source table to import them into MySQL. It's a bit frustrating that MySQL doesn't seem to handle the same characters that Access and Firebird 2.0.1 deal with without fuss (once the correct character set is configured, of course!). There remains the other major problem of handling of non-unicode NLS mappings (Greek, Cyrillic, Slavic, etc), but I'll deal with that on a record-by-record basis at a later date. But to import about 1000 records containing various unicode characters is my main focus. Any suggestions? I'm happy to post examples, error messages, character values, whatever it takes! I'd really like to solve this problem, or at least understand why the mappings aren't correct. with regards, Brad Wilson (a href=http://www.netpharmaworld.com/purchase/caverta.asp;Caverta /a|a href=http://www.trustpharma.com/purchase/kamagra.asp;kamagra/a) -- 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: import unicode characters
I've discovered the same thing as Peter, although I'm using different tools (Upscene's Database Workbench Pro 2.8.10) to import the data from both MDB and Firebird tables, which both handle the unicode (DBCS) character set acceptably well. Having said that, I've also tried command-line importing from native and delimited text versions of my source data, and I get exactly the same errors as I see in DBW. e.g. : Incorrect string value: 'Agnetha F\xE4ltskog' for column 'artistname' at row 1 I'm using MySQL V5.0.45 x64. I've tried every different combination of character set for the columns in the destination MySQL table, and neither single nor double-byte characters seem to be imported properly. I've also tried using different table types (InnoDB and MySAM) to see if that makes any difference. It doesn't appear to (i.e. I get the same errors at the same point in the imported data). I do understand that there are some limitations in using unicode (or unicode-like) character sets, but I'm banging my brains out trying to not have to hand-edit or perform on-the-fly mappings of a couple of characters in a couple of columns in ~1200 records of a 7,000 record source table to import them into MySQL. It's a bit frustrating that MySQL doesn't seem to handle the same characters that Access and Firebird 2.0.1 deal with without fuss (once the correct character set is configured, of course!). There remains the other major problem of handling of non-unicode NLS mappings (Greek, Cyrillic, Slavic, etc), but I'll deal with that on a record-by-record basis at a later date. But to import about 1000 records containing various unicode characters is my main focus. Any suggestions? I'm happy to post examples, error messages, character values, whatever it takes! I'd really like to solve this problem, or at least understand why the mappings aren't correct. with regards, Brad Wilson http://www.netpharmaworld.com/blog http://www.trustpharma.com/blog -- 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: Resource routes with further options
Ok, I meant having a url such as /myfunction/myparam, not /myfunction?param=myparam just for the ? mark, which is not cool, but in a second thought, I'm afraid is more Restful than the first one. Thanks! Ar Chron wrote: 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: What's the best way to run (many) complex queries in a rake task ?
Just for curiosity sake, I have an index on [viewer_id, viewer_type, content_id] Maybe, you want to include the rate in the index as well? That way, everything is in the index, and I would presume, MYSQL will not have to access the table at all. -- 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] Sinatra
Is anyone familiar with Sinatra? Is it a framework used in lieu of Rails -- or within it (I cannnot really tell from the docs). Anyone's thoughts on this, pro and con? --~--~-~--~~~---~--~~ 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: Sinatra
Hi Janna, I am working on Sinatra from last 6 months, let me know if you need anything http://www.sinatrarb.com/ here get the docs, This framework is tiny but very powerful. On Fri, May 29, 2009 at 4:40 PM, JannaB mistressja...@hotmail.com wrote: Is anyone familiar with Sinatra? Is it a framework used in lieu of Rails -- or within it (I cannnot really tell from the docs). Anyone's thoughts on this, pro and con? --~--~-~--~~~---~--~~ 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: Two destroy methods with different behavior for the model
Thank you, Mike. I've already made two different methods, just as you explained. On May 24, 12:12 am, Mike Rose mfrosengar...@gmail.com wrote: Denis, I did this sort of thing with user accounts a while ago.. I had set up a site that needed to mark users as 'inactive' if they ever decided to close their account. Your issue with web crawlers seeing the Move to Trash link makes me think this page is public and not member-only accessible? If so, I can't think of any way to tell a spider to not look at particular parts of the text (maybe there is a way, i've always done a traditional approach and told the spider to leave my whole page alone). Either way, on to a possible solution: The two actions I would have are: (already in your code) desotry - this action houses the traditional rails destroy method that will remove the record from the table and any dependencies. (need to add) move_to_trash - the new action that will call the move_to_tash method we will create on the object in view Explanation: You should not modify the destroy action and following rails conventions and good programming practice I would not pass a parameter into a destroy action and then decide what kind of 'destroy' to execute. Rather, let's create a second action called move_to_trash with the same access privileges as the destroy. The reason we do this is because logically our two actions are doing very different things, one is destroying a sql record and the other is changing an attribute on an object. So we add a move_to_trash method to the model and subsequently we will want a new column on our model moved_to_trash (boolean). Now the move_to_trash action will call the model.move_to_trash and then that method will called a self.update_attribute(:moved_to_trash, true). [[Alternatively, this is where I like to encourage using enums in your database and have your model have states. It could be very clean to have a column status and then you have :moved_to_trash, :inbox, :other_cool_states ]] Hopefully you find this helpful. If you provide more details about your particular situation we can work out a solution that fits. On May 22, 1:54 am, Denis Kokin denis.ko...@gmail.com wrote: Thank you, Frederick. Can you give me more details? Some sample code would be useful for me. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email to rubyonrails-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: 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? No; as I say, this was 10+ years ago. Again, I'm not arguing what it should be, nor what it originally was; however, I am telling you that a lot professional engineers, including me, were originally taught that business logic belonged in controllers. When I first learned of MVC, I was undergraduate student, not an expert on OOD. I don't code my Rails apps with thick Controllers, but I am bothered by this cult-like adherence to some One True Way of Agile programming. We're going to end up with a lot of bad software and lousy developers. 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. This is widely considered a good idea != This is 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/. Whether TDD is a good idea has nothing to do with how functionality should be apportioned among Model, View, and Controller. In particular, Controllers need tests of their own, no matter how much functionality you stick in the Models. (Unless you're going for only a Model/View paradigm, as some would argue Java Swing uses.) 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. I believe you've been misled, and that you are mistaken. I'm not sure how else to say that, nor do I have any interest in arguing with a zealot who makes such absolutisms. 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... Rails is more wizard driven than MFC ever was, with scripts to generate just about everything. MFC was that way because it was meant to encourage consistent look and feel among applications; Rails is that way because it relies heavily on conventions to work properly. If you really want to pick an our way or the highway development framework, take a look at Cocoa. --~--~-~--~~~---~--~~ 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: observe_form, observe_field, dynamic forms help please
Hi, Can you please specify the in detail the observe_field that you have used for 2x radio buttons?? Im also facing the same problem. My observe field is working fine for 3 radio buttons but for 3 I dont understand hoe to make it work?? krunk- wrote: Setup: A form which initially has only one field: a 2x group of radio_buttons. As the user selects options, additinal fields are added or removed. I started with observe_field. I was getting some very peculiar behavior from observe_field and finally figured out why = Observe field only works for the first click. So it's not suitable for a form that reacts to user input since a user may select/unselect an option multiple times. Next, I decided to use observe_form. At first, it seemed to overcome the problems of observe_field and reacted to every click of the radio_button. But then I discovered that it doesn't observe changes in fields that are not in the original source (the fields added by the user). So I'm back to ground zero. I suppose I could build all the DOM objects from scratch and roll my own functions for adding/removing and call them via onclick(), but I was hoping to get away from some of the: var myDiv = document.createElement('div'); var link = document.createElement('a'); link.setAttribute('href', 'somepage.php'); var text = document.createCreateTextNode('Link Name'); link.appendChild(text); myDiv.appendChild(link); in lieu of rjs goodness like: myElement = diva href='somepage.php'Link Name/a/div page.replace_html :elementId, myElement Any help appreciated -- 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: observe_form, observe_field, dynamic forms help please
Sorry. Its working fine with 2 radio buttons but not for 3. -- 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] tests problem - NoMethodError: private method `gsub' called for 117681882:Fixnum
Hi, i got very strange problem connected to tests in Rails. I got the same application code version as my team has, and on their computer all tests pass, and on my laptop (debian 5, ruby 1.8.6/1.8.7 (tried both), rails 2.3.2) i got more then 50 errors - majority of them is variations of NoMethodError: private method `gsub' called for 117681882:Fixnum error in controller. Anyone know how to fix it/has this problem before? I reinstalled ruby and rails about three times, clearing gems etc every time but with no effect... --~--~-~--~~~---~--~~ 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: import unicode characters
Thanks for all , i have solved problem , it was only text-editor options , i changed scite standarts (encoding=utf-8) and it's worked :) On May 29, 12:47 pm, Brad Wilson rails-mailing-l...@andreas-s.net wrote: I've discovered the same thing as Peter, although I'm using different tools (Upscene's Database Workbench Pro 2.8.10) to import the data from both MDB and Firebird tables, which both handle the unicode (DBCS) character set acceptably well. Having said that, I've also tried command-line importing from native and delimited text versions of my source data, and I get exactly the same errors as I see in DBW. e.g. : Incorrect string value: 'Agnetha F\xE4ltskog' for column 'artistname' at row 1 I'm using MySQL V5.0.45 x64. I've tried every different combination of character set for the columns in the destination MySQL table, and neither single nor double-byte characters seem to be imported properly. I've also tried using different table types (InnoDB and MySAM) to see if that makes any difference. It doesn't appear to (i.e. I get the same errors at the same point in the imported data). I do understand that there are some limitations in using unicode (or unicode-like) character sets, but I'm banging my brains out trying to not have to hand-edit or perform on-the-fly mappings of a couple of characters in a couple of columns in ~1200 records of a 7,000 record source table to import them into MySQL. It's a bit frustrating that MySQL doesn't seem to handle the same characters that Access and Firebird 2.0.1 deal with without fuss (once the correct character set is configured, of course!). There remains the other major problem of handling of non-unicode NLS mappings (Greek, Cyrillic, Slavic, etc), but I'll deal with that on a record-by-record basis at a later date. But to import about 1000 records containing various unicode characters is my main focus. Any suggestions? I'm happy to post examples, error messages, character values, whatever it takes! I'd really like to solve this problem, or at least understand why the mappings aren't correct. with regards, Brad Wilsonhttp://www.netpharmaworld.com/bloghttp://www.trustpharma.com/blog -- 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] steps for creating rails engine ?
Hi all, I want to create a small rails engine (like community engine) which require me in future's project also. but I don't know how? Is it same as creating a rails application and merge that in another application.? What are the steps for creating rails engine? please give me related link also if possible. Thanks, Vikas. -- 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 __________
Jeff Schwab wrote: take a look at Cocoa. Which, by the way, is probably the most brilliantly conceived event-driven MVC framework I've ever had the pleasure of using. The very fact that you play by it's rules by doing things it's way is much of what makes it so. -- 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 __________
Robert Walker wrote: Jeff Schwab wrote: take a look at Cocoa. Which, by the way, is probably the most brilliantly conceived event-driven MVC framework I've ever had the pleasure of using. The very fact that you play by it's rules by doing things it's way is much of what makes it so. Correction: its rules and its way. Sorry for the misuse of the apostrophe. -- 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] sql - migrations ?
Is there a way to take a db schema (say, as sql statements) and reverse that back into files to use for migrations? how do you handle legacy db's -- do you have to go and write the migration files yourself from scratch? -Janna B. --~--~-~--~~~---~--~~ 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 site on CD
Hi All I've been asked to provide a copy of a site I've just put together on a CD so that it can be tailed in with a Powerpoint presentation (I presume links from the presentation to a local copy of the site). Does anyone have any thoughts on how one could go about this? The only thought I had was to find a way to automate a visit to every page and then store a copy of the page as a static html file. All suggestions gratefully received! Thanks Robin --~--~-~--~~~---~--~~ 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: assert_valid in unit tests after upgrade to rails 2.3 doesn't work
hi, just upgrading to 2.3.2 and getting same, did you resolve this at all? Tonypm --~--~-~--~~~---~--~~ 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: Rails site on CD
Robin Fisher wrote: Does anyone have any thoughts on how one could go about this? The only thought I had was to find a way to automate a visit to every page and then store a copy of the page as a static html file. When you use caches_page in your controllers it'll create a directory structure in your public directory that includes static versions of the pages you set to use. After you do that, you can just take the public directory and browse through that omitting the rest of the app. That would probably be the best way to go about it. -- 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: Rails site on CD
http://www.bestechvideos.com/2009/03/21/railslab-scaling-rails-episode-2-page-caching There's a good screencast to get you started. -- 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] Question about Rails-formatted query params in URL
Hi all, I am seeing a behavior for which I can't find documentation. I am posting a form to a url with query params formatted in the Rails manner: /controller/action?foo[bar]=3 # Of course, the brackets are properly encoded When doing this, the actual form fields get lost, e.g. params[:foo] # This gives {:bar = 3} even though the form has other fields for foo. Any ideas? Thanks so much, Brian Hartin -- 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: SubDomain Queries
Hi Sahil, If someone types in blog.company.com, you will need access to the server on which that domain resides in order to redirect it to your app, it has nothing to do with how you structure your application. If you setup a redirect, then the user will see yourapp.com/blog/:id unless you reconfigure the routes in routes.rb. The alternative so that the user sees blog.company.com is to frame your site on the company.com website although this is considered slightly 2001 and not really the done thing. Robin On May 29, 7:28 am, Sahil Dave sahil.dav...@gmail.com wrote: 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: Rails site on CD
Great stuff! Thanks Jack! On May 29, 3:02 pm, Jack Bauer rails-mailing-l...@andreas-s.net wrote: Robin Fisher wrote: Does anyone have any thoughts on how one could go about this? The only thought I had was to find a way to automate a visit to every page and then store a copy of the page as a static html file. When you use caches_page in your controllers it'll create a directory structure in your public directory that includes static versions of the pages you set to use. After you do that, you can just take the public directory and browse through that omitting the rest of the app. That would probably be the best way to go about it. -- 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: assert_valid in unit tests after upgrade to rails 2.3 doesn't work
Ok, so Rails Guide http://guides.rubyonrails.org/testing.html para 3.5 says it exists - I guess the guide needs amending? It was deprecated at 2.2.2 - assert_valid is deprecated. Use assert record.valid? instead see http://github.com/rails/rails/commit/d4754677a34d34d4a0955a04f2cc6571bdc5e82d and https://rails.lighthouseapp.com/projects/8994/tickets/1470-assert_valid-undefined-in-edge-activesupporttestcase I didnt want to go change all my tests just at the moment, so putting assert_valid in my test_helper gets me over that for the moment. Bit of a time waster, since I was going from 2.0.2 to 2.3 so had not seen the dep error. def assert_valid(record) assert record.valid?, record.errors.full_messages.join(\n) end Tonypm --~--~-~--~~~---~--~~ 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 __________
Robert Walker wrote: Jeff Schwab wrote: take a look at Cocoa. Which, by the way, is probably the most brilliantly conceived event-driven MVC framework I've ever had the pleasure of using. The very fact that you play by it's rules by doing things it's way is much of what makes it so. Mostly agreed. It's very much like Rails, or C++ template metaprogramming, in the sense that convention is leveraged to define program structure. Restrictions aren't necessarily a bad thing. The one aspect of Cocoa development that does really bother me is that it's only really meant to be done in XCode, with which I am not thrilled. --~--~-~--~~~---~--~~ 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: Sinatra
JannaB wrote: Is anyone familiar with Sinatra? Is it a framework used in lieu of Rails -- or within it (I cannnot really tell from the docs). Haven't used it (yet) however just to say its an alternative 'light-weight' framework to rails. -- 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] [JOB] Exciting funded NYC startup seeking Ruby developers
Fast-growing tech startup is seeking an expert Ruby on Rails developer to join our intimate tech team in a key role. Successful candidate will have a minimum of two years experience deploying scalable RoR applications and five years of general software development experience. ZepInvest.com is a premium content aggregation engine created to open up the premium web. We are doing for subscription websites what search engines did for the free web. We are a well funded startup with an all-star team. Responsibilities: •Roll-out dependable software to support major publishing organizations and paying online consumers •Establish engineering best practices such as code reviews, design guidelines, and check-in policies •Improve performance, scalability, and availability of our systems •Communicate with technology and business teammates Minimum Qualifications: •2 yrs demonstrated coding skills in Ruby on Rails •3 years of MySQL development experience •5 years of software development experience •Experience/familiarity with Mongrel or Passenger Phusion •2 years of working in an apache environment •SVN •Knowledge of Linux and open-source technologies •Familiarity with agile development practices •Solid understanding of Service Oriented Architecture/SOAP •Understanding of semantic web •Experience working with C/C++ plus •ActivePresenter a plus •Strong Javascript/AJAX/JSON/JQuery skills are a plus While we prefer a full time candidate we are open to contract or contract to hire. Other Keywords: RoR, SOA, gem, fun, flexible, dynamic, casual NO CONTRACT FIRMS NO OUTSOURCING FIRMS NO H1-B CANDIDATES Send a resume to mherschb...@zepinvest.com -- 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
I fixed all my issues and am up and running. Here's what I did to fix them all... First, I had to uninstall my old ruby and gems.. In my case I had to do sudo gem uninstall --install-dir /path/to/directory NameOfGem to uninstall all of mine because gem uninstall could not find them. I did that first by just doing a locate (name of gem) to see which directory it was in. I uninstalled all the gems and then I uninstalled Ruby using the following: sudo apt-get remove rubygems ruby irb ri rdoc ruby1.8-dev .. that solved the uninstall issues. Installing Ruby 1.9.1 and Rails I created a checklist of everything I did when installing ruby and rails from source in case someone else has the same issues I did. Here's the instructions. Prep Tools and Libraries 1. Download latest 1.9.1 source and place in Directory/src. 2. Go to terminal and type the following: 3. TYPE sudo apt-get install build-essential wget libreadline5-dev libncurses5-dev zlib1g-dev libsqlite3-dev libssl-dev Installing Ruby Source 1. Go to src directory on desktop via terminal. 2. Type ls to see name of package. 3. Type tar xvzf (name of package) 4. Type rm *.gz (to remove the .gz src file) 5. Type cd ruby(tab) to finish dir typing 6. Type autoconf (to check if autoconf is there) 7. Type sudo apt-get install autoconf (to install autoconf) 8. Type autoconf 9. Type ./configure --prefix=/usr --enable-pthread 10. Type make 11. Type sudo make install Check Versions 1. Type ruby -v (should be latest version) 2. Type gem -v (should be latest version) 3. Type sudo gem update (everything should be up to date) 4. Type irb (to access IRB) 5. Type RUBY_VERSION (should show latest version) Install Rails and other gems 1. Type sudo gem install rails sqlite3-ruby rubygems-update test-unit capistrano rspec 2. Type rails -v (to check rails version) 3. Type rails testapp 4. Type cd testapp 5. Type script/server 6. Open Browser 7. Type http://localhost:3000 Everything should be running fine. In my case I'm up and running. As a new user to linux I had to research several sites to find all the information. -- 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: Rails site on CD
Robin Fisher wrote: Hi All I've been asked to provide a copy of a site I've just put together on a CD [...] There have been a number of discussions on this list about packaging a Rails application for local execution. Joyent's Slingshot seems to be what I hear come up most often, and it also might be feasible to package it as a java app with JRuby. These solutions should help if static pages are not what you need. 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: ruby 1.9.1, cygwin rails 2.3.2: undefined method camelize
I'm not having trouble installing rails. Ruby 1.9.1 came with its own copy of the gem binary which I have all installed in a separate hierarchy. But, when I run the rails command to create a new test application, that's when I get the undefined method camelize for app:String I have googled around a bit and found a reference to a FreeBSD user having the same problem. As I said earlier, this works perfectly on my Mac OS X Leopard system so I'll do most of my concept work there using ruby 1.9.1 rails 2.3.2. If anyone has any other ideas, I'm all ears. Luckily I don't absolutely have to have this working on cygwin ... it would just be nice. My Ruby 1.8.x / Rails 2.3.2 Environments all work fine. This is just for Ruby 1.9.1p129 + Rails 2.3.2 which I'm having trouble with. Yes, I really want to use Ruby 1.9.1 for projects that are not in production yet as this gives me exposure to the the new ruby and will help me eventually with porting of my old apps. Actually, I've ported a few of my Rails applications from Ruby 1.8.6/ Ruby 1.8.7 to Ruby 1.9.1 with very minor effort so it's not as big of a deal as people seem to make it out. Thanks for your suggestion anyway. Dan On May 26, 3:14 pm, Conrad Taylor conra...@gmail.com wrote: Sent from my iPhone On May 26, 2009, at 12:21 PM, dmack danmack-gm...@macktronics.com wrote: I tried to get this working and ran into a problem: - latest cygwin - ruby 1.9.1p129 (same problem with p0). install in /opt/ruby19 - rails 2.3.2 1) Installed ruby 1.9.1p129 with: --prefix=/opt/ruby19. No errors or problems. make install worked. 2) gem install rails No problem, rails installs just fine in the /opt/ruby19 hierarchy. 3) Attempt to create a new rails application: FAILED (cygwin) % rails testapp undefined method `camelize' for app:String The back-trace: undefined method `camelize' for app:String /opt/ruby19/lib/ruby/gems/1.9.1/gems/rails-2.3.2/lib/rails_generator/ spec.rb:29:in `class_name' /opt/ruby19/lib/ruby/gems/1.9.1/gems/rails-2.3.2/lib/rails_generator/ spec.rb:38:in `block in lookup_class' /opt/ruby19/lib/ruby/gems/1.9.1/gems/rails-2.3.2/lib/rails_generator/ spec.rb:36:in `each_object' /opt/ruby19/lib/ruby/gems/1.9.1/gems/rails-2.3.2/lib/rails_generator/ spec.rb:36:in `lookup_class' /opt/ruby19/lib/ruby/gems/1.9.1/gems/rails-2.3.2/lib/rails_generator/ spec.rb:18:in `klass' /opt/ruby19/lib/ruby/gems/1.9.1/gems/rails-2.3.2/lib/rails_generator/ lookup.rb:140:in `instance' /opt/ruby19/lib/ruby/gems/1.9.1/gems/rails-2.3.2/lib/rails_generator/ scripts.rb:31:in `run' /opt/ruby19/lib/ruby/gems/1.9.1/gems/rails-2.3.2/bin/rails:18:in `top (required)' /opt/ruby19/bin/rails:19:in `load' /opt/ruby19/bin/rails:19:in `main' Anyone have any ideas on how this could be fixed? If I use a 1.8.x version of ruby, everything works fine. ??? Thanks, Are you wanting to use ruby 1.9.1 or ruby 1.8.6? If you're trying to use ruby 1.9.1, then you you'll want to use the gem command for it. For example, the command might be gem1.9 install rails instead of gem install rails -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 -~--~~~~--~~--~--~---
[Rails] Book Shelf app in 'Ruby on Rails Bible' book
I'm trying to follow through with the Book Shelf app that's in the 'Ruby on Rails Bible' book and I'm at a point where I'm trying to install Ruby/Amazon. I downloaded the Ruby/Amazon and extracted it as instructed. Now I'm at the step where I need to drop into a Ruby console to verify the Ruby/Amazon installation. In the console I typed : require 'amazon/aws/search' RuntimeError: Unsupported digest algorithm (sha256). from /Users/kevin/dev/Ruby/book_shelf/lib/amazon/aws/search.rb:34:in `initialize' from /Users/kevin/dev/Ruby/book_shelf/lib/amazon/aws/search.rb:34:in `new' from /Users/kevin/dev/Ruby/book_shelf/lib/amazon/aws/search.rb:34 from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `gem_original_require' from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `require' from /Library/Ruby/Gems/1.8/gems/activesupport-2.3.2/lib/ active_support/dependencies.rb:156:in `require' from /Library/Ruby/Gems/1.8/gems/activesupport-2.3.2/lib/ active_support/dependencies.rb:521:in `new_constants_in' from /Library/Ruby/Gems/1.8/gems/activesupport-2.3.2/lib/ active_support/dependencies.rb:156:in `require' from (irb):1 I'm too much of Ruby n00b to know what that error means or how to resolve it. Any suggestions? It probably has something to do with the fact that I'm using different versions of Ruby, rails, gems, Ruby/ Amazon since that book was written in '08 (likely '07). Ruby --~--~-~--~~~---~--~~ 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: tests problem - NoMethodError: private method `gsub' called for 117681882:Fixnum
Hmm, fixed. Problem Was sqlite as test database, setting it to mysql fix the problem. On May 29, 12:27 pm, Piotr Szmielew p.szmie...@ava.waw.pl wrote: Hi, i got very strange problem connected to tests in Rails. I got the same application code version as my team has, and on their computer all tests pass, and on my laptop (debian 5, ruby 1.8.6/1.8.7 (tried both), rails 2.3.2) i got more then 50 errors - majority of them is variations of NoMethodError: private method `gsub' called for 117681882:Fixnum error in controller. Anyone know how to fix it/has this problem before? I reinstalled ruby and rails about three times, clearing gems etc every time but with no effect... --~--~-~--~~~---~--~~ 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: SubDomain Queries
Apache and mod_rewrite will be your friend. I would also setup a virtualhost for the blog.company.com But are you saying that you have mycompany.com which is a rails app and you want your blog.othercompany.com to use your blog controller? Or when people go on your blog they should see blog.mycompany.com in the browser? --~--~-~--~~~---~--~~ 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 REE and Passenger: http://phusion.nl/ Cheers, Sazima On May 29, 12:59 am, J. D. rails-mailing-l...@andreas-s.net 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.. 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 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: autocomplete fill in text fields
When the autocomplete value is selected do an ajax call to your application returning the data you need to fill in using a format you can parse in JavaScript like JSON and set the form values. On May 29, 12:36 am, Me chabg...@gmail.com wrote: 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] assert method is not visible?
Hi, test is_admin method is not visible do get :is_admin assert_??? end is_admin is protected and should stay that way forever. What assertion do I use? M. -- 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: autocomplete fill in text fields
ok where do I do that at? On Fri, May 29, 2009 at 11:29 AM, jay jaypow...@gmail.com wrote: When the autocomplete value is selected do an ajax call to your application returning the data you need to fill in using a format you can parse in JavaScript like JSON and set the form values. On May 29, 12:36 am, Me chabg...@gmail.com wrote: 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: block pop-up for rails apps
any idea how can i stop the pop ups because my google ads campaing is rejected due to this issue On May 28, 6:00 pm, Shuaib85 shuaib.za...@gmail.com wrote: Hi all Sometimes on some ISP, my application pop ups some ads for that company. However, some other websites do not get the pop up when I open the website using the same ISP. Is there a way that I can block those pop ups, thanks --~--~-~--~~~---~--~~ 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: block pop-up for rails apps
On May 29, 2009, at 1:00 PM, Shuaib85 wrote: any idea how can i stop the pop ups because my google ads campaing is rejected due to this issue Pay for real hosting? This is not a Rails question but an ISP question. On May 28, 6:00 pm, Shuaib85 shuaib.za...@gmail.com wrote: Hi all Sometimes on some ISP, my application pop ups some ads for that company. However, some other websites do not get the pop up when I open the website using the same ISP. Is there a way that I can block those pop ups, thanks --~--~-~--~~~---~--~~ 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: Robert Walker wrote: Mostly agreed. It's very much like Rails, or C++ template This seems to me to be a gross oversimplification. While there may be some similarities, in that they both implement the basic MVC design pattern, Cocoa development involves design patterns that are rarely seen in Rails, or any other web framework. Patterns such as chain of responsibility, decorator/delegation, command, composite/view hierarchy, key value code/key value observing. My only real point here is that any similarities with Rails falls away very quickly when you get into the inner workings of the Cocoa framework. metaprogramming, in the sense that convention is leveraged to define program structure. Restrictions aren't necessarily a bad thing. The one aspect of Cocoa development that does really bother me is that it's only really meant to be done in XCode, with which I am not thrilled. I do admit that Xcode's text editor could use some work. However, I'd rather use Xcode's integrated editor over many of the other IDEs I've used like Eclipse, NetBeans, JDeveloper, etc. However, as Jim stated, you don't have to use it. You can use whatever editor you want. The fact is though, that there is much more focus placed on features for dealing with the complexities of desktop application development, which don't apply to web based frameworks like Rails. All you really need to develop a Rails application is a text editor and a command line. Xcode is, by necessity, much more that a simple text editor. -- 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: block pop-up for rails apps
On May 29, 8:51 pm, Rob Biedenharn r...@agileconsultingllc.com wrote: On May 29, 2009, at 1:00 PM, Shuaib85 wrote: any idea how can i stop the pop ups because my google ads campaing is rejected due to this issue Pay for real hosting? Yes, I am taking a real hosting plan. This is not a Rails question but an ISP question. On May 28, 6:00 pm, Shuaib85 shuaib.za...@gmail.com wrote: Hi all Sometimes on some ISP, my application pop ups some ads for that company. However, some other websites do not get the pop up when I open the website using the same ISP. Is there a way that I can block those pop ups, thanks --~--~-~--~~~---~--~~ 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, I have the solution. Here I correct the wrong function of Date.parse: class Date class self alias :oldparse :_parse def _parse(str, comp=false) if str =~ /(\d{1,2})\.(\d{1,2})\.(\d\d\d\d)\ (\d{1,2})\:(\d\d)/ e = Format::Bag.new e.mday = $1.to_i e.mon = $2.to_i e.year = $3.to_i e.hour = $4.to_i e.min = $5.to_i return e.to_hash end if str =~ /(\d{1,2})\.(\d{1,2})\.(\d\d\d\d)/ e = Format::Bag.new e.mday = $1.to_i e.mon = $2.to_i e.year = $3.to_i return e.to_hash end oldparse(str, comp) end end end -- 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] Full text search on Rails using the acts_as_solr plugin
Hi everyone, We've just released our fork of the acts_as_solr plugin that we've been using for a while now to power the full text search on our projects. The fork features some changes to the way configurations are made, updates Solr and the Jetty HTTP server, better error handing, is fully compatible with will_paginate view helpers and :page/:per_page options and we feel it's a great option to the Rails full text search plugins. Obviouly the plugin keeps one of the best features that is the live index update (no need to write cron tasks or anything to update your models, once your active_record object is saved or updated it's sent to be indexed by Solr). If anyone is interested in checking it out, here's our sample tutorial at GitHub - http://wiki.github.com/mauricio/acts_as_solr And here's the plugin repo - http://github.com/mauricio/acts_as_solr/tree/master Cheers and I hope this email doesn't stars a flamewar ;) - Maurício Linhares http://alinhavado.wordpress.com/ (pt-br) | http://blog.codevader.com/ (en) --~--~-~--~~~---~--~~ 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: block pop-up for rails apps
Someone told me about a javascript code that solves this problem. I am not sure whether this true or not On May 29, 9:24 pm, Shuaib85 shuaib.za...@gmail.com wrote: On May 29, 8:51 pm, Rob Biedenharn r...@agileconsultingllc.com wrote: On May 29, 2009, at 1:00 PM, Shuaib85 wrote: any idea how can i stop the pop ups because my google ads campaing is rejected due to this issue Pay for real hosting? Yes, I am taking a real hosting plan. This is not a Rails question but an ISP question. On May 28, 6:00 pm, Shuaib85 shuaib.za...@gmail.com wrote: Hi all Sometimes on some ISP, my application pop ups some ads for that company. However, some other websites do not get the pop up when I open the website using the same ISP. Is there a way that I can block those pop ups, thanks --~--~-~--~~~---~--~~ 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] shortcut to call js function
Is there a shortcut for this kind of thing: %if X=42% script type=text/javascript some_funct() /script %end% -- 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: shortcut to call js function
Mk 27 wrote: Is there a shortcut for this kind of thing: %if X=42% script type=text/javascript some_funct() /script %end% I'm not sure, but if there isn't, a helper method would be trivial to write. However, you probably shouldn't be writing that sort of code in the first place: * if X=42 should be if x == 42. * JavaScript belongs in external files, not in the view. (Just like CSS -- although you *can* include it inline, it's a very bad idea.) * Depending on what you're doing, this may be too much logic for the view. 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] Forum integration
Hello , Is there any plugin or gem for rails 1.2.* which can be integrate in existing application. -- 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: shortcut to call js function
Sorry, yeah, that should be == some_func() is in an external file, but it does need to be called from in the view. Your assertion that javascript does not belong there is patently ridiculous since many of the normal rails functions deploy JS/AJAX, in the view. A central conceit of rails is XMLHttpRequest, and it is deployed IN THE VIEW. I will investigate writing a helper, 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: shortcut to call js function
Mk 27 wrote: Sorry, yeah, that should be == some_func() is in an external file, but it does need to be called from in the view. Why? What does it do? Can you use event handlers instead? Your assertion that javascript does not belong there is patently ridiculous No it's not. It is in fact generally accepted, though there may be a little disagreement over precise details. (I'll admit that I tend to be towards the extreme side of the debate.) since many of the normal rails functions deploy JS/AJAX, in the view. Yes, this is one reason I'm not all that keen on the implementation of Rails' JS helpers (although lowpro greatly helps, and it's certainly far easier than doing Ajax without helpers). A central conceit of rails is XMLHttpRequest, and it is deployed IN THE VIEW. I wonder if we're using in the view in the same sense here. Certainly it's true that the XmlHttpRequest is triggered in the view, but the JavaScript code for it should be in a separate file from the HTML/ERb/Haml/whatever. (Yes, I've used these principles in complex Ajax apps.) Generally speaking, it should never be necessary to have any more JS in your HTML files than you can fit into a simple onclick attribute (actually, even that's not strictly necessary, and I prefer to avoid it when I can through good use of onload). In particular, script tags in the body are almost certainly a sign of poor design practice (the exception would be for external libraries like Google Analytics and Facebook Connect). In sum, then...please don't tell me what I say is patently ridiculous unless you're sure of it. Rails does not always do things in the best way possible where generating JS (and SQL) is concerned. I will investigate writing a helper, thanks. OK. 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: shortcut to call js function
On May 29, 2009, at 4:13 PM, Marnen Laibow-Koser wrote: Mk 27 wrote: Is there a shortcut for this kind of thing: %if X=42% script type=text/javascript some_funct() /script %end% I'm not sure, but if there isn't, a helper method would be trivial to write. However, you probably shouldn't be writing that sort of code in the first place: * if X=42 should be if x == 42. * JavaScript belongs in external files, not in the view. (Just like CSS -- although you *can* include it inline, it's a very bad idea.) * Depending on what you're doing, this may be too much logic for the view. Best, -- Marnen Laibow-Koser http://www.marnen.org mar...@marnen.org On May 29, 2009, at 4:26 PM, Mk 27 wrote: Sorry, yeah, that should be == some_func() is in an external file, but it does need to be called from in the view. Your assertion that javascript does not belong there is patently ridiculous since many of the normal rails functions deploy JS/AJAX, in the view. A central conceit of rails is XMLHttpRequest, and it is deployed IN THE VIEW. I will investigate writing a helper, thanks. It already exists: %= javascript_tag(some_func()) if x == 42 -% -Rob Rob Biedenharn http://agileconsultingllc.com r...@agileconsultingllc.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: shortcut to call js function
Marnen Laibow-Koser wrote: In sum, then...please don't tell me what I say is patently ridiculous It still seems to me that it is. Where there is html, there can be javascript. I would far rather use one line script type=text/javascriptcreate_menu_div(some parameters)/script Than cut and paste the 20-50 lines of html this could represent, esp. since it will allow the use of DOM*. Also, using an event handler still entails putting some javascript in an html page somewhere. You have hit a paradox by saying that you want to use prototype, etc. but you do not want to see any js calls in your html files. I do understand it is an explicit goal of rails to minimize the amount of js that the developer has to deal with personally, but I am already comfortable with it. I could tie my left hand to the chair in order to guarantee that only my right hand will be used for typing, but why bother? Anyway, Marnen, these are *cosmetic* preferences. I would just hate to see the day when some weirdo consortium comes along and says From now on, everyone must tie their left hand to the chair, altho I doubt that will be possible in this case. *meaning there may be more unfortunate use of javascript still to come :O -- 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: shortcut to call js function
Rob Biedenharn wrote: I will investigate writing a helper, thanks. It already exists: %= javascript_tag(some_func()) if x == 42 -% Thanks Rob! I was sure I had run across this somewhere, but I have been rummaging thru so much new material while learning I was totally clueless as to where. Perhaps I should take more notes... -- 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] Mi browser no muestra el formato para captura desplegado
Hola, Soy nuevo totalmente con ruby on rails..de hecho durante 15 a#os programe con un RAD que no maneja codigo asi que estoy intentando retomar este tipo de lenguajes nuevamente..y vaya que si han cambiando. Estoy siguiendo un tutorial que indica como hacer una aplicacion sencilla llamada 'DEPOT', despues de sortear algunos problemas de configuracion de mysql y el mismo rails logre llegar al punto donde se me indica que ejecute el comando: ruby script/generate scaffold Product Segun esto este comando me generara el controlador, el modelo y la vista adecuados para ejecutar las altas bajas y cambios a mi tabla de 'Products' que previamente defini en mi base de datos (depot_development)en mysql. Una vez que levanto el servidor ejecuto en el browser: http://localhost:3000/Products y el browser me regresa lo siguiente: Listing products Show Edit Destroy Show Edit Destroy Show Edit Destroy New product y bueno, efectivamente la tabla tiene ya 3 registros, la cosa aqui es que no me muestra el contenido de los registros solo las opciones para manipularlos o la opcion para crear uno nuevo...si le doy click a 'New product' me muestra otra pagina pero no me muestra los campos para yo ingresar datos. de hecho borre la aplicacion y volvi a generar todo segun el demo pero nada, sigue igual. Algun paso hice mal o no se que pasa..pareciera que el controlador no esta invocando las vistas (formatos) de despliegue. Alguna idea o comentario seran de gran ayuda. Gracias. Jose -- 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: legacy db connection
Siddick Ebramsha wrote: Try with :class_name option in has_many method. has_many :freak_items, :foreign_key = projectId, :class_name = Freak_Item Thanks - didn't work though :S -- 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: shortcut to call js function
Mk 27 wrote: Marnen Laibow-Koser wrote: In sum, then...please don't tell me what I say is patently ridiculous It still seems to me that it is. Where there is html, there can be javascript. Yes. There can also be CSS. There *should* be neither. I would far rather use one line script type=text/javascriptcreate_menu_div(some parameters)/script Than cut and paste the 20-50 lines of html this could represent, esp. since it will allow the use of DOM*. Apparently you don't understand what I'm getting at here. I'm not talking about cutting and pasting HTML as an alternative to inline JS (although that's trivial with a partial or a helper, which should be your first choices if all you need is repeating elements). Rather what I'm talking about is simply having div class=menu/div in your HTML, then do something like window.onload = function () { $$('.menu').each(function (div) { createMenuDiv(e); }; }; in the separate JS file. Much cleaner; much better separation of presentation and behavior. Almost (M)VCish -- the JS is sort of the client-side controller. Also, using an event handler still entails putting some javascript in an html page somewhere. Not necessarily. You can use the onload technique (as above) to assign behavior without a single JS call in the HTML. All you need is the external script tag in the head. You have hit a paradox by saying that you want to use prototype, etc. but you do not want to see any js calls in your html files. It's not a paradox at all. It's perfectly feasible, and I know because I have done it. I do understand it is an explicit goal of rails to minimize the amount of js that the developer has to deal with personally, but I am already comfortable with it. So am I -- comfortable enough to know that I don't like Rails' approach that much (although I do use it here and there for simplicity's sake). I could tie my left hand to the chair in order to guarantee that only my right hand will be used for typing, but why bother? I'm really not impressed by the analogy. Properly separated JS is a little harder to set up initially, but is much easier to deal with later. Come to think of it, the same could be said of frameworks such as Rails... Anyway, Marnen, these are *cosmetic* preferences. I would just hate to see the day when some weirdo consortium comes along and says From now on, everyone must tie their left hand to the chair, altho I doubt that will be possible in this case. Again: it is possible. It is feasible. It's not even particularly difficult. I have done it on a complex application, and would do it again in similar circumstances. It is not a cosmetic preference, but rather an architectural one. And it is not my idea alone -- it comes from the JS guidelines of Douglas Crockford ( http://www.crockford.com ), who is or was a JS architect at Yahoo! (he's also the guy who discovered JSON and the classical inheritance patterns in JS). If you're working with JS, I strongly recommend poking around his site if you haven't already -- there's lots of useful stuff. *meaning there may be more unfortunate use of javascript still to come :O Well, yeah... 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: shortcut to call js function
Marnen Laibow-Koser wrote: It still seems to me that it is. Where there is html, there can be javascript. Yes. There can also be CSS. There *should* be neither. WHY!???!? You want to make web programming *more* limited that it already is?? I agree when convienient but Rather what I'm talking about is simply having div class=menu/div in your HTML, then do something like window.onload = function () { 1) what if this menu is part of a view being loaded into an existing div, and not part of a fresh page 2) create_menu_div would imply (or at least, I would hope) to me something a little bit more significant than just assigning some style. I do use a function like this, and it takes an array of choices (for the menu options) and a callback containing a switch(); the number of the choice corresponds to this, so rather than having to write a slew of onclick statements, etc, choices = [do this, do that, do both]; create_menu_div(style, choices, parnt, callback); Also, using an event handler still entails putting some javascript in an html page somewhere. Not necessarily. You can use the onload technique (as above) to assign behavior without a single JS call in the HTML. All you need is the external script tag in the head. The head I would say is part of an html page. It's not a paradox at all. It's perfectly feasible, and I know because I have done it. Yeah, because you use ruby shortcuts. The JS still ends up in the page. All you have to do is look at the source generated for a rails app page (any and all of them) to find more inline javascript than you can shake a stick at. Again: it is possible. It is feasible. It's not even particularly difficult. Sure, and again I agree: as convenient. By not possible I meant that I sincerely hope that people with your opinion do not come up with a means of *forcing* everyone else to comply, and I do believe that will not be possible, in fact. Thankfully. -MK ps. with your penchant for waving credentials and experience, the biggest question in my mind would be why the simple answer Rob gave was evidently out of your range... -- 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: legacy db connection
Are you getting an error message that you can post? On May 29, 2:24 pm, Bill McGuire rails-mailing-l...@andreas-s.net wrote: Siddick Ebramsha wrote: Try with :class_name option in has_many method. has_many :freak_items, :foreign_key = projectId, :class_name = Freak_Item Thanks - didn't work though :S -- 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: shortcut to call js function
To me, the greatest gain unobtrusive Javascript provides is maintainability. You split the client-side logic (that is *all* Javascript is) from the view for the same reason you split the controller processing and buisness logic from the view with an MVC framework. In addition to all Marnen said: your views become much easier to test; You spend less time adapting the HTML your designer gives you (or that you mock up yourself); It's *much* easier to focus on providing an intuitive interface for those with or without Javascript enabled. Just a couple specific points: 1) what if this menu is part of a view being loaded into an existing div, and not part of a fresh page $(element).live(event, function...) I'm sure non-JQuery'ers have something similar Yeah, because you use ruby shortcuts. The JS still ends up in the page. All you have to do is look at the source generated for a rails app page (any and all of them) to find more inline javascript than you can shake a stick at. Don't use the RJS helpers, no inline JS. And if you think not using the RJS helpers is limiting, I doubt you've really explored the powers JS frameworks. It still seems to me that it is. Where there is html, there can be javascript. Yes. There can also be CSS. There *should* be neither. WHY!???!? Semantic markup that knows little about how it'll be displayed is far easier to maintain, and offers *more* presentational flexibility via your stylesheets. On May 29, 7:52 pm, Marnen Laibow-Koser rails-mailing-l...@andreas- s.net wrote: Mk 27 wrote: Marnen Laibow-Koser wrote: It still seems to me that it is. Where there is html, there can be javascript. Yes. There can also be CSS. There *should* be neither. WHY!???!? You want to make web programming *more* limited that it already is?? No, I want to separate behavior and presentation. That's just good architecture. Nothing I am recommending makes Web programming any more limited. If anything, it has the opposite effect, since it organizes the code better. I agree when convienient but Rather what I'm talking about is simply having div class=menu/div in your HTML, then do something like window.onload = function () { 1) what if this menu is part of a view being loaded into an existing div, and not part of a fresh page I *think* the principle still works. 2) create_menu_div would imply (or at least, I would hope) to me something a little bit more significant than just assigning some style. I do use a function like this, and it takes an array of choices (for the menu options) and a callback containing a switch(); the number of the choice corresponds to this, so rather than having to write a slew of onclick statements, etc, choices = [do this, do that, do both]; create_menu_div(style, choices, parnt, callback); Not sure I understand from that description. I'll reread when I'm less pressed for time. Also, using an event handler still entails putting some javascript in an html page somewhere. Not necessarily. You can use the onload technique (as above) to assign behavior without a single JS call in the HTML. All you need is the external script tag in the head. The head I would say is part of an html page. Yes. That's not what I meant. Rather, I meant that the script tag points to an external file, so there is *not a single line of JS* in the HTML file. I'm sure you already handle CSS this way, with style tags pointing to external file. Why is it so hard to grasp the concept of doing the same for JS? It's not a paradox at all. It's perfectly feasible, and I know because I have done it. Yeah, because you use ruby shortcuts. The JS still ends up in the page. Wrong. The complex Ajax work I have done was in an application that did not involve Rails, or indeed any other framework with JS helpers. I know precisely how much literal JS wound up in the HTML generated by that application: none. I made sure of that, and would do it exactly the same way again in a similar case, Rails or no Rails. All you have to do is look at the source generated for a rails app page (any and all of them) to find more inline javascript than you can shake a stick at. Yes, if you use Rails' JS helpers without the UJS or Lowpro plugins. This is why I don't like to do that. At the very least, use one of those plugins to separate your JS and HTML. Again: it is possible. It is feasible. It's not even particularly difficult. Sure, and again I agree: as convenient. By not possible I meant that I sincerely hope that people with your opinion do not come up with a means of *forcing* everyone else to comply, and I do believe that will not be possible, in fact. Thankfully. Yeah, I don't know that I'd want that either. Choice is a good thing, but with choice comes responsibility -- just because you *can* write JS inline doesn't mean you should. OTOH, I really
[Rails] Re: Question on Hosting and Rails
On Fri, May 29, 2009 at 5:00 PM, J. D. rails-mailing-l...@andreas-s.net wrote: My current host is gatorhost.com. They use Ruby 1.85 and rails 2.3.2 I use Ruby 1.9.1 and rails 2.3.2. Will I have a problem with any of my rails environment apps if I use them on my hosted domain? Murphy's Law sez: yes. If it were me, I'd set up a VM with the same configuration as the host you're deploying to and at least pre-deploy to it and *run your tests*. Then, if it fails in production, you know what new tests to write. :-) FWIW, -- 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: shortcut to call js function
Marnen Laibow-Koser wrote: The head I would say is part of an html page. Yes. That's not what I meant. Rather, I meant that the script tag points to an external file, so there is *not a single line of JS* in the HTML file. Alright, I'll think about it. I have probably written 1000 lines of .js in my life*, no doubt there are angles and possibilities I am not aware of. Here is an example callback for the menU_div_create function I mentioned, if this will clarify with the crude switch mechanism: function mainmenu (num) { switch (num) { case 0: if (!DBname) { alert(You must create a new database first!); break; } var tmp=prompt(Record name:); new ListRecord(tmp); break; case 1: if (current==-1) { alert(No record selected!); break; } var tmp=prompt(Field name:); new formDBentry(tmp,undefined); break; case 2: submit_form(); break; case 3: window.open(mkdb_load.pl,_self); break; case 4: tmp=prompt(Database name:); if (tmp == ) break; DBname=tmp; clear_start(); default: break; } } the array corresponding to this (5 options that are the text for the menu): var mmenu=[Add Record, Add Field, Save, Load, New]; and here is the real make_menu function, it does not actually involve a div; but usually the parnt is (and callback is the function above): /* make_menu is not real OO */ function make_menu (type, css, choices, callback, parnt) { var i=0; var tmp, strng; do {tmp=document.createElement(type); tmp.setAttribute(class,css); strng=callback+(+i+); tmp.setAttribute(onclick,strng); tmp.textContent=choices[i]; parnt.appendChild(tmp); i++; } while (choices[i]); } I haven't used this in rails, but I am using js functions that to my mind are similar in the sense that I do not see a way out of inlining them. Hopefully, in time I will learn. *but I am still snobbish coming from the real languages ;) -- 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: Question on Hosting and Rails
Good idea - thanks mate -- 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] HELP ON MY VALIDATION
Hi.. I use text field with auto complete for my authority_name field which will be fetched from userinfo table and the field name is login. Authority Name %=text_field_with_auto_complete :userinfo, :login% this authority name will be stored in company table. what my problem is i want to validate the above auto complete field... i tried the validates presence of it gets me error. i could not use as %=f.text_field_with_auto_complete :userinfo, :login% what is the reason..pls guide me...on the validation 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 -~--~~~~--~~--~--~---