Re: [Rails] Re: Re: foo_path not defined

2012-06-06 Thread Jeremy Walker
On 6 Jun 2012, at 18:21, Perry Smith li...@ruby-forum.com wrote: Colin Law wrote in post #1063357: On 6 June 2012 15:33, Perry Smith li...@ruby-forum.com wrote: Thanks. I checked http://guides.rubyonrails.org/routing.html first. The code I have, to my eyes, match the lead examples in

Re: [Rails] Double render in rails

2012-06-05 Thread Jeremy Walker
On 5 June 2012 15:22, kingston.s jenorishs...@gmail.com wrote: Hi all, Is double render or redirect possible in rails..? Could you provide a example of what you're trying to achieve, please. Please tell me if possible Thanks -- You received this message because you are

Re: [Rails] Re: Routing error: no route matches contoller works. Route exists though

2012-06-05 Thread Jeremy Walker
On 5 June 2012 18:08, Martyn W. li...@ruby-forum.com wrote: Hassan Schroeder wrote in post #1063180: On Tue, Jun 5, 2012 at 9:56 AM, Martyn W. li...@ruby-forum.com wrote: I dont understand why after failing the save in the controller and trying to render new it would give me a route

Re: [Rails] Problem with array of hashes

2012-06-05 Thread Jeremy Walker
On 5 Jun 2012, at 18:58, cyber c. li...@ruby-forum.com wrote: Hi , I have created an array of hashes using Model file class Class A ActiveRecord::Base def fill_paths paths = Array.new for file in @files path = {} path[a] = file path[b] = DATA2(assume data2

Re: [Rails] Re: Problem with array of hashes

2012-06-05 Thread Jeremy Walker
On 5 June 2012 19:19, cyber c. li...@ruby-forum.com wrote: Jeremy W. wrote in post #1063195: On 5 Jun 2012, at 18:58, cyber c. li...@ruby-forum.com wrote: for file in @files @paths = A.fill_paths for path in @paths puts path.a end I cant access path.a, which says

Re: [Rails] Re: Problem with array of hashes

2012-06-05 Thread Jeremy Walker
On 5 June 2012 23:01, cyber c. li...@ruby-forum.com wrote: Hi Jeremy, Thanks for the reply. I want to populate my DB during init one time by crawling through a set of directories with filenames and paths. How do i do this? Where, or how? Where: db/seeds.rb How: Iterate through directories

Re: [Rails] Rails Step by Step Tutorial for ubuntu

2012-06-04 Thread Jeremy Walker
On 4 June 2012 21:05, Code Man li...@ruby-forum.com wrote: Hello, I was wondering if anyone knows of a good step by step tutorial to install Apache + Mysql + PHPmyadmin + Ruby + Rails or any other web server to develop in rails in Ubuntu (Linux), I been to trying to install it but it is

Re: [Rails] Re: Rails Step by Step Tutorial for ubuntu

2012-06-04 Thread Jeremy Walker
On 4 June 2012 21:32, Code Man li...@ruby-forum.com wrote: Hello Jeremy, before anything thanks for da reply, What I want is to start developing a website on Rails, nothing else, I wanted to use mysql because it what my hosting provides, so the question is what you recommend me to develop?

Re: [Rails] Beginner's:Problem with populating database

2012-06-04 Thread Jeremy Walker
On 5 June 2012 01:02, cyber c. li...@ruby-forum.com wrote: Hi, I wanted to populate the DB with (name,data) pairs based on some rules. I have created a scaffold with name and data as attributes. In the controller file under the def for index, i have changed the line @data_pairs =

Re: [Rails] Gem Dependency error

2012-06-01 Thread Jeremy Walker
On 31 May 2012, at 13:52, Subal Charla subalcha...@gmail.com wrote: I am following Michael Hartl's Tutorial on RoR. During the 3rd Chapter (sample_app), I am trying to install the gems via the bundle install --without production command but I keep encountering the following issue:

Re: [Rails] Relationship issue with activerecord rails

2012-05-29 Thread Jeremy Walker
On 29 May 2012 12:56, Steve Knit li...@ruby-forum.com wrote: I am still learning Rails, I've read some books and did some hands on at codeschool.com and now I'm trying to write my first simple app from scratch. I'm using devise for authentication, but since i still kinda suck at rails, I

Re: [Rails] Re: Relationship issue with activerecord rails

2012-05-29 Thread Jeremy Walker
On 29 May 2012 13:14, Steve Knit li...@ruby-forum.com wrote: Thanks for pointing me to @pets = admin.pets.all but now I'm getting the error ActiveRecord::StatementInvalid in PetsController#index SQLite3::SQLException: no such column: pets.admin_id: SELECT pets.* FROM pets WHERE

Re: [Rails] Re: Relationship issue with activerecord rails

2012-05-29 Thread Jeremy Walker
On 29 May 2012 13:26, Steve Knit li...@ruby-forum.com wrote: Hello Jeremy, thanks for providing me your experience and quick response! You're welcome! So you know, it's customary to post your responses in the relevant place of a thread, rather than top-posting. It makes the conversation

Re: [Rails] Can't get css to load in rails 3.2.3 development

2012-05-26 Thread Jeremy Walker
On 26 May 2012, at 22:33, Colin Law clan...@googlemail.com wrote: On 26 May 2012 22:18, Vell lovell.mcilw...@gmail.com wrote: On Saturday, May 26, 2012 4:45:13 PM UTC-4, Colin Law wrote: On 26 May 2012 21:39, Vell lovell.mcilw...@gmail.com wrote: On Saturday, May 26, 2012 12:07:33

Re: [Rails] gemlock and rails version

2012-05-25 Thread Jeremy Walker
On 26 May 2012 01:20, S Ahmed sahmed1...@gmail.com wrote: Trying to understand how the version of rails is handled in the gem file, if you do: gem rails and call bundle, it from what I understand will pull down the latest stable release right? And then a gemlock file is created, which

Re: [Rails] Heroku Deploy - assets issue_paperclip

2012-05-24 Thread Jeremy Walker
On 24 May 2012, at 15:10, Miguel A. li...@ruby-forum.com wrote: Hi all, I'm deploying my app on heroku for tests and have noticed something odd. My understanding (and experience) is that you can't modify the heroku file system once your application slug has been generated and uploaded, so

Re: [Rails] loop in rails view

2012-05-22 Thread Jeremy Walker
On 22 May 2012 15:36, amvis vgrkrish...@gmail.com wrote: On Tuesday, 22 May 2012 10:23:53 UTC-4, Juan Pablo Avello wrote: El martes, 22 de mayo de 2012 15:56:54 UTC+2, amvis escribió: On Tuesday, 22 May 2012 09:34:20 UTC-4, azizmb.in wrote: Also, you could clean things a little by

Re: [Rails] i want a rails job

2012-05-21 Thread Jeremy Walker
Hello. England, Birmingham. On 21 May 2012 19:21, Lupu Alexandru Emil gang.al...@gmail.com wrote: What country? What city ? On May 16, 2012, at 6:39 PM, Alex G wrote: hi, all i want a rails job, part time or remotely i have worked with rails for 4 years,i just want to learn english

Re: [Rails] Error : can't dup NilClass, in Heroku

2012-05-21 Thread Jeremy Walker
On 21 May 2012, at 17:07, johan rincon nahoj28naho...@gmail.com wrote: Hi, The application is deployed on Heroku, is based on Ruby 3.2.1 and Rails 1.9.2. Sometimes a function of my props starts throwing this error StringUtils:dateTimeFromString, str , can't dup NilClass and I

Re: [Rails] Chain scopes with OR

2012-05-21 Thread Jeremy Walker
! Jeremy Walker http://www.ihid.co.uk Thanks for you attention, Gustavo On Fri, May 18, 2012 at 3:52 PM, azizmb.in m...@azizmb.in wrote: To add to that, if you want to construct complex queries, you should have a look at arel https://github.com/rails/arel. On Sat, May 19, 2012 at 12:17 AM

Re: [Rails] Re: Can't mass-assign these protected attributes?

2012-05-18 Thread Jeremy Walker
On 17 May 2012 22:56, David D. li...@ruby-forum.com wrote: I have found a solution to this problem (solution is geared for the newest version of rails etc, as of mid May 2012) If you are simply doing early stage development stuff, you do not need the extra feature which blocks mass

Re: [Rails] Proxy Model Class

2012-05-18 Thread Jeremy Walker
On 19 May 2012 00:28, mengu whalb...@gmail.com wrote: hello everyone, is it possible to instantiate a model class with it's id instead of pulling it from the db? SomeObject obj = SomeObject.new obj.id = 10 Is that what you mean? What's your use-case for this? thanks in advance. --

Re: [Rails] ajax issue with rails

2012-05-16 Thread Jeremy Walker
On 16 May 2012 11:55, amvis vgrkrish...@gmail.com wrote: $(.sub123).click(function() { var mnum = $(#mnum).val(); var dataString = 'value='+ mnum; if(mnum=='') { $('.error').fadeIn(300).show(); $('.error').fadeOut(3000); } else { $.ajax({ type: GET, url:

Re: [Rails] Rails 3.1.0 cannot connect to sqlite database on Mac Lion

2012-05-16 Thread Jeremy Walker
On 16 May 2012 03:42, Scott Eisenberg sco...@btrtrucks.com wrote: I'm running Rails 3.2.3 on Mac Lion with sqlite 3.7.7 and ruby 1.9.3p125. I need to back down rails to 3.1.0 for a project but when I do that a simple index page give me a ActiveRecord::ConnectionNotEstablished error. What

Re: [Rails] How to display a string the way it was entered ( w return new line)

2012-05-16 Thread Jeremy Walker
On 16 May 2012 16:25, Erwin yves_duf...@mac.com wrote: On input in a text area, the user can se the return key which generate a \r\n inside the string the address is stored per se the way it was keyed in .. @partner[:bank_location] = 92, Place Honoré d'Urfé\r\n35140, La

Re: [Rails] Re: How to display a string the way it was entered ( w return new line)

2012-05-16 Thread Jeremy Walker
this and discovered there's a helper called simple_format that does exactly the same thing. On May 16, 5:47 pm, Jeremy Walker jez.wal...@gmail.com wrote: On 16 May 2012 16:25, Erwin yves_duf...@mac.com wrote: On input in a text area, the user can se the return key which generate

Re: [Rails] How to crop and show external image with specific size?

2012-05-16 Thread Jeremy Walker
On 16 May 2012 21:20, regedarek dariusz.fins...@gmail.com wrote: I get image url via API. It usualy have 360x200 but sometimes 233x350 etc.. I would like to crop them all to specific size 260x186. And show them using %= image_tag image_url if hotel.images.first % I dont want to

Re: [Rails] Re: Help with model :conditions

2012-05-15 Thread Jeremy Walker
:redirect_to_page as the later sounds like an instruction not a name. Let me know how you get on. Jeremy Walker On May 14, 1:22 pm, Jeremy Walker jez.wal...@gmail.com wrote: On 14 May 2012 18:16, Tuckie witu...@gmail.com wrote: Sadly, no dice: Cannot visit Proc Extracted source (around line #12

Re: [Rails] Help with model :conditions

2012-05-14 Thread Jeremy Walker
!= #{self.id}' Use double quotes, not single quotes around id != #{self.id} You might be better doing the following instead to avoid SQL injection: :conditions = ['id != ?', self.id] Jeremy Walker ... -- You received this message because you are subscribed to the Google Groups Ruby on Rails

Re: [Rails] Re: Help with model :conditions

2012-05-14 Thread Jeremy Walker
?hl=en%C6%91a8df27585ace3 Ok, yeah. You are right. That's a very old thread and I suspect this many have changed now. It was a very ugly workaround. You can now use a proc, so :conditions = proc {['id != ?', id]} Does that work for you? On May 14, 9:20 am, Jeremy Walker jez.wal...@gmail.com

Re: [Rails] Re: Help with model :conditions

2012-05-14 Thread Jeremy Walker
{['redirect_to_page_id != ?', id]} I've checked this on a standard relationship without the class_name and foreign_key and it works perfectly. On May 14, 10:23 am, Jeremy Walker jez.wal...@gmail.com wrote: On 14 May 2012 15:13, Tuckie witu...@gmail.com wrote: Thanks for the quick response

Re: [Rails] Re: How to intercept each action call?

2012-05-11 Thread Jeremy Walker
On 12 May 2012 01:48, Lauro Caetano laurocaeta...@gmail.com wrote: Thanks for your help Dheeraj, but I'm trying to do something like Responders. Responders has a respond_to :html in controllers, that is used in each action call to respond_with. The thing is: call a specific method that is

Re: [Rails] Re: How to intercept each action call?

2012-05-11 Thread Jeremy Walker
and saving it. I think that I've explained better now. 2012/5/11 Jeremy Walker jez.wal...@gmail.com On 12 May 2012 01:48, Lauro Caetano laurocaeta...@gmail.com wrote: Thanks for your help Dheeraj, but I'm trying to do something like Responders. Responders has a respond_to :html in controllers

Re: [Rails] select box pre-selecting an option

2012-05-10 Thread Jeremy Walker
On 10 May 2012 11:45, Michael Baldock li...@ruby-forum.com wrote: Can anyone please tell me what's going on here, I've copied something pretty much directly from rails guides, but it's just not doing what it's supposed to! (Or I'm doing something stupid!) rails - 3.2.2 ruby 1.9.3 my

Re: [Rails] Re: select box pre-selecting an option

2012-05-10 Thread Jeremy Walker
On 10 May 2012 12:13, Michael Baldock li...@ruby-forum.com wrote: Thanks for that, it works exactly as you said! cheers, now I have the line %= f.select(:formation_csv, @formations) % and it magically knows which one to select. I'm still v curios as to why the

Re: [Rails] Rails 3.2.3 not including javascript

2012-05-10 Thread Jeremy Walker
On 10 May 2012 14:26, Beau beautr...@gmail.com wrote: Howdy, Using rails 3.2.3 and ruby 2.0.0dev. Running rails s, doesn't seem to include the javascript. This causes Delete/destroy to never work. It just defaults to a GET and thus show. I tested this in a barebones project rails new

Re: [Rails] Is it suitable using STI?

2012-05-10 Thread Jeremy Walker
On 10 May 2012 16:05, Greg Akins angryg...@gmail.com wrote: On Thu, May 10, 2012 at 10:57 AM, Mauro mrsan...@gmail.com wrote: I have problems on a simple design problem. I have many companies. Each company have one or more commercial activity. Activities types are: ecommerce, local unit,

Re: [Rails] Is it suitable using STI?

2012-05-10 Thread Jeremy Walker
On 10 May 2012 16:26, Mauro mrsan...@gmail.com wrote: On 10 May 2012 17:05, Greg Akins angryg...@gmail.com wrote: On Thu, May 10, 2012 at 10:57 AM, Mauro mrsan...@gmail.com wrote: I have problems on a simple design problem. I have many companies. Each company have one or more

Re: [Rails] Has_Many, another mass assign headache

2012-05-09 Thread Jeremy Walker
On 9 May 2012 16:42, Miguel A. li...@ruby-forum.com wrote: I'm using rails 3.2.3 and am having issues with mass assignement. I have a Hotel model and a Hphoto model (integrated with paperclip) I have tried almost everything and still get mass-assignement error. What's the actual error that

Re: [Rails] Re: Has_Many, another mass assign headache

2012-05-09 Thread Jeremy Walker
On 9 May 2012 16:56, Miguel A. li...@ruby-forum.com wrote: What's the actual error that you get? Can't mass-assign protected attributes: hphoto app/controllers/hotels_controller.rb:52:in `new' app/controllers/hotels_controller.rb:52:in `create' Have you tried attr_accessible :hphoto

Re: [Rails] Re: Re: Has_Many, another mass assign headache

2012-05-09 Thread Jeremy Walker
On 9 May 2012 17:15, Miguel A. li...@ruby-forum.com wrote: Have you tried attr_accessible :hphoto rather than (or in addition to) attr_accessible :hphoto_attributes ? If i add to the Hphoto model: attr_accessible :hphoto, :hphoto_attributes the result is the same. If I also add

Re: [Rails] Help Query Cache

2012-05-08 Thread Jeremy Walker
On 8 May 2012 19:22, Marcelo G. Silva mgsw...@gmail.com wrote: Well folks let me try to explain my problem. I have a database of musics and each music can have multiple artists through other table/model in the case Performers. I would like to record music in new/edit add artists and select

Re: [Rails] ActiveRecord Postgres small inconsistency

2012-05-07 Thread Jeremy Walker
fastest to produce. (See ORDER BY Clause below.) So, shouldn't ORDER BY .. ASC be specified explicitly, instead of relying on an implementation detail that might later change? This strikes me as a good suggestion. I'll put a pull request together for it unless anyone has any objections. Jeremy

Re: [Rails] ActiveRecord Postgres small inconsistency

2012-05-07 Thread Jeremy Walker
On 7 May 2012 17:34, Jeremy Walker jez.wal...@gmail.com wrote: On 7 May 2012 08:31, rahaji...@bankofbaku.com rahaji...@bankofbaku.comwrote: Hi, I'm using Rails 3.2.1 and following through Mike Hartl's tutorial. irb(main):024:0 User.first User Load (0.6ms) SELECT users.* FROM users

Re: [Rails] Use of Super or how to get the calling object.

2012-05-06 Thread Jeremy Walker
On 6 May 2012, at 04:29, Niklas Nson niklasn...@me.com wrote: Thank you for a great answer, i wanted to move it from the User model - but i guess the smartest way is to keep it in there, also did the renaming to update_setting ... Again thank you! My pleasure! I understand not wanting

Re: [Rails] run script after initialize

2012-05-06 Thread Jeremy Walker
just reopen ActiveRecord::Base. Create a new initializer (a ruby file in config/initializers) with: class ActiveRecord::Base def new_method # do stuff end end Does that help? Jeremy Walker http://www.ihid.co.uk Thanks! -- Posted via http://www.ruby-forum.com/. -- You received

Re: [Rails] Re: run script after initialize

2012-05-06 Thread Jeremy Walker
On 6 May 2012 22:13, Guillem Vidal li...@ruby-forum.com wrote: Jeremy Walker wrote in post #1059748: On 6 May 2012, at 20:22, Guillem Vidal li...@ruby-forum.com wrote: ActiveRecord::Base.send(:descendants) and ActiveRecord::Base.send(:subclasses) is allways empty []. I've tried

Re: [Rails] Use of Super or how to get the calling object.

2012-05-05 Thread Jeremy Walker
. You might be able to go further and make it more sensible, but I think a method on user is better. Does any of that help? Jeremy Walker http://www.ihid.co.uk what i want is to be abel to make a call like: user = User.find(1) user.settings.set(test, test) Is this possible or am i just way

Re: [Rails] Can't push to Heroku

2012-05-03 Thread Jeremy Walker
: https://devcenter.heroku.com/articles/how-do-i-use-sqlite3-for-development https://devcenter.heroku.com/articles/local-postgresql To use sqllite in dev and postgres in production: http://railsapps.github.com/rails-heroku-tutorial.html Do those help? Jeremy Walker -- You received this message

Re: [Rails] haml and w3c validator

2012-05-03 Thread Jeremy Walker
On 3 May 2012 13:35, angel david li...@ruby-forum.com wrote: Hi All, I have a doubt regarding haml and w3c validator. Is w3c validator compatible for code written in haml? Because I have done a project full in haml and its the need that there is no errors in w3c. But I have some errors

Re: [Rails] Re: Country State City using AJAX

2012-05-03 Thread Jeremy Walker
On 3 May 2012, at 14:06, AJ akshar.jamgaon...@gmail.com wrote: Hello All, ill just summarize everything in this message..kindly suggest as to what might be wrong Do you have a div with the id of client_state_id? What do you get if you run $(#client_state_id) in firebug? Jeremy Walker

Re: [Rails] Re: Country State City using AJAX

2012-05-03 Thread Jeremy Walker
. On Thu, May 3, 2012 at 6:46 PM, Jeremy Walker jez.wal...@gmail.com wrote: On 3 May 2012, at 14:06, AJ akshar.jamgaon...@gmail.com wrote: Hello All, ill just summarize everything in this message..kindly suggest as to what might be wrong Do you have a div with the id

Re: [Rails] Re: Country State City using AJAX

2012-05-03 Thread Jeremy Walker
) { $(#client_state_id).replaceWith(data); } }); Hope that's helpful. On Thu, May 3, 2012 at 7:02 PM, Jeremy Walker jez.wal...@gmail.comwrote: On 3 May 2012, at 14:24, akshar jamgaonkar akshar.jamgaon...@gmail.com wrote: Yes i have a Select box with this id = client_state_id

Re: [Rails] inheritance with rails.

2012-05-03 Thread Jeremy Walker
the SuperSTI gem that I think offers a nicer solution. Read about it at http://www.ihid.co.uk/projects/super_sti and https://github.com/ihid/super_sti Feel free to email me personally to discuss it further. Jeremy Walker http://www.ihid.co.uk -- You received this message because you are subscribed

Re: [Rails] inheritance with rails.

2012-05-03 Thread Jeremy Walker
On 3 May 2012 15:49, Mauro mrsan...@gmail.com wrote: On 3 May 2012 16:41, Jeremy Walker jez.wal...@gmail.com wrote: On 3 May 2012 15:28, Mauro mrsan...@gmail.com wrote: Hello. I've read about examples on inheritance with rails. Here is an example: http://juixe.com/techknow

Re: [Rails] Scaffoldings should be made in a temporary folder.

2012-05-02 Thread Jeremy Walker
, then don't generate scaffolding, just generate a resource. If the functionality is going to be along the lines of a form-based resource, then I've found that scaffolding can be a helpful start. Jeremy Walker http://www.ihid.co.uk -- You received this message because you are subscribed to the Google Groups

Re: [Rails] jruby/rack stack dumps without reference to my code

2012-05-02 Thread Jeremy Walker
with that! :) Jeremy Walker -- 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

Re: [Rails] Rails and the Ubuntu command line

2012-05-02 Thread Jeremy Walker
case the command will work as expected, or use rails depot to create your app. You can then cd into the directory and run generate commands. Jeremy Walker -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To view this discussion

Re: [Rails] Column with dynamic db type

2012-05-02 Thread Jeremy Walker
repository at http://github.com/ihid/super_sti might help. Email me personally if you want some help with that repository. Jeremy Walker http://www.ihid.co.uk I would like to know if you have a better solution than this one: Question: question:string answer_type:string AnsweredQuestion