[Rails] JS template engines with Rails... opinions?

2011-09-04 Thread David Kahn
I am considering going the route of javascript templates for my app, and trying to determine the negatives to doing this. The primary reasons I am looking at this: 1) Rails 3 + coffeescript is amazing and I see going in a more object oriented direction with js now. That lends to passing data to my

Re: [Rails] Do I need only Ruby on Rails?

2011-09-01 Thread David Kahn
On Thu, Sep 1, 2011 at 9:56 PM, Kurtis Rainbolt-Greene < kurtisrainboltgre...@gmail.com> wrote: > Hey Samuel, > > > > though I learnt they're switching to scala > > They're not actually switching to Scala. They're porting a large > portion of their computational work to the JVM with Scala being on

Re: [Rails] Is a bad practice to do this while testing with Rspec?

2011-08-28 Thread David Kahn
On Sun, Aug 28, 2011 at 10:29 AM, Ezequiel Schwartzman wrote: > I'm testing the validation of emails so I did the following: > > it 'should only allow domains names with numbers, letters, dots or > dashes' do >(%-\\|!"#$\%&/()=?¡;,:{}+'<>°+*[]"¬~^@áéíóú´`_ -).each_char do > |c| >

Re: [Rails] Re: Local timezone issues

2011-08-28 Thread David Kahn
On Sun, Aug 28, 2011 at 8:09 AM, Frederick Cheung < frederick.che...@gmail.com> wrote: > > > On Aug 28, 2:56 pm, comopasta Gr wrote: > > Hi, > > > > So I store Visit records in UTC: 2011-08-28 13:23:48.714506 > > I am in timezone +3 so I can verify that the stored created at is in > > UTC. > > >

[Rails] Re: Moving js to vendor/assets/javascripts/ is not picked up

2011-08-25 Thread David Kahn
On Wed, Aug 24, 2011 at 4:13 PM, 7stud -- wrote: > What does your Gemfile look like? > Full gemfile: source 'http://rubygems.org' gem 'rails', '3.1.0.rc5' # Bundle edge Rails instead: # gem 'rails', :git => 'git://github.com/rails/rails.git' gem 'pg' gem 'validates_timeliness', '~> 3.0.

[Rails] Moving js to vendor/assets/javascripts/ is not picked up

2011-08-24 Thread David Kahn
Hey all, quick question. I am using Rails 3.1 rc5 and when I move my vendor js libraries to vendor/assets/javascripts, the browser does not receive them. Is there something I need to to in order for this to happen? I thought based on all I have read that this should be an automatically included dir

[Rails] Re: how to work in group?

2011-08-17 Thread David Kahn
On Wed, Aug 17, 2011 at 2:58 PM, Frederick Cheung < frederick.che...@gmail.com> wrote: > > > On Aug 17, 7:23 pm, Rodrigo Ruiz wrote: > > hi, I've started developing websites with rails about 3 months ago, > > and now I need to work with for people at the same project. > > How can I do that? > > >

[Rails] Mailer failure: ArgumentError: A sender (Return-Path, Sender or From) required to send a message

2011-08-16 Thread David Kahn
On Tue, Aug 16, 2011 at 1:38 PM, 7stud -- wrote: > What is the output when you try this: > > def password_reset_instructions(user) > @user = user > p @user > @url = edit_password_reset_url(user.perishable_token) > mail(:to => user.email, :subject => 'Password Reset for > Wa

[Rails] Mailer failure: ArgumentError: A sender (Return-Path, Sender or From) required to send a message

2011-08-16 Thread David Kahn
I have two mailer procedures in the same app and same mailer (Rails 3.1/1.9.2). The first one fails with the message below, the second works fine. Both these results are through irb. Anyone have an idea as to why? Also, in my application.rb I do have: ActionMailer::Base.default :from => "WaveLineup

[Rails] Downloading files not stored in database?

2011-07-24 Thread David Kahn
On Sun, Jul 24, 2011 at 2:08 PM, Jen wrote: > ** > On 24/07/11 17:08, David Kahn wrote: > > > > > > > >> >> If I could get the text that is shown for each link stored in to a >> variable I could parse it to the upload method in the controller (

[Rails] Downloading files not stored in database?

2011-07-24 Thread David Kahn
On Sun, Jul 24, 2011 at 10:17 AM, Jen wrote: > Hello list, > > I am trying to add functionality to my application that will allow users to > download files that are not stored in a database. > > All the examples I have found find the file by ID. which I can not do. Here > is my code from the view

Re: [Rails] Re: ANN: PDFTron PDFNet SDK for RUBY

2011-06-03 Thread David Kahn
On Fri, Jun 3, 2011 at 9:43 AM, Walter Davis wrote: > > On Jun 3, 2011, at 9:58 AM, David Kahn wrote: > > >> >> On Fri, Jun 3, 2011 at 8:25 AM, paul h wrote: >> >> >> On Jun 3, 12:50 am, pdftrn wrote: >> > ANNOUNCING: >> > >> &

Re: [Rails] Re: ANN: PDFTron PDFNet SDK for RUBY

2011-06-03 Thread David Kahn
On Fri, Jun 3, 2011 at 8:25 AM, paul h wrote: > > > On Jun 3, 12:50 am, pdftrn wrote: > > ANNOUNCING: > > > > PDFTron PDFNet SDK v.5.7. - A Ruby Extension module for all types of > > PDF processing including rendering, conversion, editing, and creation. > > > > WHAT IT IS: > > > > PDFNet SDK is

Re: [Rails] REMOVE ME

2011-06-02 Thread David Kahn
Careful what ask for :) On Thu, Jun 2, 2011 at 2:16 PM, Jatin kumar wrote: > +1 Conrad > > > On Thu, Jun 2, 2011 at 12:06 PM, Conrad Taylor wrote: > >> On Thu, Jun 2, 2011 at 10:58 AM, Brian wrote: >> >>> REMOVE ME >>> >>> >> To unsubscribe from this group, send email to >> rubyonrails-talk+uns

Re: [Rails] Calendars in Rails

2011-05-31 Thread David Kahn
On Tue, May 31, 2011 at 12:18 AM, Piter Fcbk wrote: > Hi all, > I'm currently in the need to implement a calendar in rails. > It should be able to present a year, month and day view. > The events in these 3 views should be able to be opened, on click, to view > the information and/or edit it (acc

Re: [Rails] rails habtm checkboxes with jquerymobile

2011-05-30 Thread David Kahn
On Mon, May 30, 2011 at 6:27 PM, Jason Fleetwood-Boldt wrote: > > On May 30, 2011, at 6:27 PM, David Kahn wrote: > > > data-role="controlgroup"> > > > > Jquery > > > > Web > > > > > > David, > >

Re: [Rails] rails habtm checkboxes with jquerymobile

2011-05-30 Thread David Kahn
On Mon, May 30, 2011 at 2:47 PM, Federico Rota wrote: > Hi guys, I have a habtm association working properly. My application > consists of both a desktop and a mobile version. > My mobile version is made with jquerymobile and I would like my checkboxes > in the edit form to look like the checkboxe

Re: [Rails] "Modular" application design - controller / route setup

2011-05-30 Thread David Kahn
On Mon, May 30, 2011 at 3:26 PM, Mickiii wrote: > I am fairly new to rails, and have been through a few books, and am > now starting to sketch out an application, however I have run into a > problem with regards to the structure of the app. > > I want to build an application that is setup in modu

[Rails] How to get error message out of ActiveRecord::Base.connection.raw_connection

2011-05-29 Thread David Kahn
I run this code to import a large csv file into a table in Postgres: connection = ActiveRecord::Base.connection.raw_connection connection.exec(%q[COPY import_xp_raw_bill_details FROM STDIN DELIMITERS ',' CSV]) data = File.open(file_path).read data.each_line {|line| connecti

Re: [Rails] Re: What is the equivalent for write_attribute for associations in Rails?

2011-05-28 Thread David Kahn
On Sat, May 28, 2011 at 11:57 AM, Frederick Cheung < frederick.che...@gmail.com> wrote: > > > On May 28, 5:18 pm, egervari wrote: > > One thing I don't necessarily like about Rails is that whenever you > > want to do something that is out of the norm just a bit - but not > > unreasonable by any m

Re: [Rails] Re: Rails Routes/Controller/Directory Structure design question

2011-05-27 Thread David Kahn
On Fri, May 27, 2011 at 9:11 PM, egervari wrote: > How do you deal with form_for's when the routes are nested? > > For example, let's say you have a Admin::CompaniesController in > your :admin namespace. The model is obviously Company. I get an error > for new forms: > ><%= simple_form_for(@c

Re: [Rails] Re: json ERROR: Failed to build gem native extension

2011-05-27 Thread David Kahn
n: rvmsudo gem install json > > On May 28, 11:15 am, eka wrote: > > On May 28, 10:49 am, David Kahn wrote: > > > > > On Fri, May 27, 2011 at 7:41 PM, eka wrote: > > > > I am quite new to rails and try now to set up a deployment > > > > enviro

Re: [Rails] Re: Rails Routes/Controller/Directory Structure design question

2011-05-27 Thread David Kahn
On Fri, May 27, 2011 at 8:00 PM, egervari wrote: > Oh, I also want to add that Admins will manage Users too, not just > Companies and Themes. So there is a conflict where Companies can > create/edit/delete Users and use/not use the same controller. There is > also potential route conflicts unless

Re: [Rails] Re: Rais 3, nested attributes problem with paperclip

2011-05-27 Thread David Kahn
pertaining to paperclip to see if there is anything not matching up. > > > On 28 Μάϊος, 03:44, David Kahn wrote: > > On Fri, May 27, 2011 at 7:23 PM, Yiannis wrote: > > > I have two models, one model girl and one girl_photos (a file upload > > > asset). The only code

Re: [Rails] Rails Routes/Controller/Directory Structure design question

2011-05-27 Thread David Kahn
On Fri, May 27, 2011 at 7:55 PM, egervari wrote: > I have a design question where I would appreciate a thoughtful > response. > > Let's say you have a simple application (for example's sake) that has > a User, Company and Theme model. A Company `has_one` Theme and > `has_many` Users. > > Administ

Re: [Rails] json ERROR: Failed to build gem native extension

2011-05-27 Thread David Kahn
On Fri, May 27, 2011 at 7:41 PM, eka wrote: > I am quite new to rails and try now to set up a deployment > environment. However I do not have the experience to over come every > obstacle: > > Centos 5.4 x86_64 > apache 2.2.3 > rvm 1.6.13 > ruby 1.9.2-p0 > passenger 3.0.7 > capistrano 2.5.21 > > I

Re: [Rails] Rais 3, nested attributes problem with paperclip

2011-05-27 Thread David Kahn
On Fri, May 27, 2011 at 7:23 PM, Yiannis wrote: > I have two models, one model girl and one girl_photos (a file upload > asset). The only code I have in models which describes the association > is: > > For the girl => belongs_to :girl and has_attached_file :photo > For the model girl_photos => h

Re: [Rails] Re: cannot access instance variable in mailer view

2011-05-27 Thread David Kahn
ly recall that I had the same issue, hence the name. I think I decided that @body must be reserved or used by rails somewhere. Anyhow, glad it helped! > Thanks, > Stephen > > > > On May 27, 6:00 pm, David Kahn wrote: > > On Fri, May 27, 2011 at 4:40 PM, Stephen Huey >

Re: [Rails] cannot access instance variable in mailer view

2011-05-27 Thread David Kahn
On Fri, May 27, 2011 at 4:40 PM, Stephen Huey wrote: > Action Mailer is detecting my HTML view but not evaluating any > instance variables I'm referencing in it. Here is my mailer: > > class Emailer < ActionMailer::Base > > def send_default(recipient, subject, message, sent_at) >@body = mes

Re: [Rails] Re: Inflection nightmare

2011-05-27 Thread David Kahn
On Thu, May 26, 2011 at 11:26 PM, Avram Dorfman wrote: > > ruby-1.8.7-p334 :004 > "regatta".singularize > > => "regattum" > > ruby-1.8.7-p334 :005 > > > > > So, no dice. Annoying and stange, huh? > > RIght, no dice. > > At this point I have wrapped the Inflections module to manually return > the

Re: [Rails] Inflection nightmare

2011-05-26 Thread David Kahn
On Thu, May 26, 2011 at 6:23 PM, David Kahn wrote: > > > On Thu, May 26, 2011 at 6:06 PM, Avram Dorfman wrote: > >> Hello, >> >> Can someone tell me how to teach the Inflector to stop treating a >> particular word as irregular that is not? >> >> I

Re: [Rails] Inflection nightmare

2011-05-26 Thread David Kahn
On Thu, May 26, 2011 at 6:06 PM, Avram Dorfman wrote: > Hello, > > Can someone tell me how to teach the Inflector to stop treating a > particular word as irregular that is not? > > I have an app that has a model named "Regatta" and another model named > "RegattaInclusion" (which is the join model

Re: [Rails] Re: Can you use meta_search from diffrent models ?

2011-05-25 Thread David Kahn
On Wed, May 25, 2011 at 10:08 AM, David Kahn wrote: > > > On Wed, May 25, 2011 at 12:08 AM, Niklas Nson wrote: > >> I get the error >> NoMethodError in Peoples#index >> Showing /Users/niklasnson/mugcube_app/mugcube/app/views/peoples/ >> index.html.erb where

Re: [Rails] Re: Can you use meta_search from diffrent models ?

2011-05-25 Thread David Kahn
t;%= f.input :screen_name_contains %> > <%= f.button :submit %> ><% end -%> > > But that resulted in the same error. > Again please copy the params from the server console on the post. Also, try using account_screen_name_contains... maybe. > > > > > On

Re: [Rails] Best place to put methods containing raw sql code

2011-05-24 Thread David Kahn
On Tue, May 24, 2011 at 3:58 PM, Kevin wrote: > I'm porting a bunch of sql queries used to generate reports of various > kinds. I have a report controller that has no model and will contain all > the actions that display report results. Where should I stick my wrapper > methods for these querie

Re: [Rails] Re: Can you use meta_search from diffrent models ?

2011-05-24 Thread David Kahn
wo models/controllers i have been using was both the same > (photo and PhotoController and casting and CastingController) so i > thought that > the error was in that Account was the model and then a > PeoplesController. But after your last message i think this should not > matter ?

Re: [Rails] Re: Can you use meta_search from diffrent models ?

2011-05-24 Thread David Kahn
ch(params[:search]) And then use the results > > /Niklas. > > On 24 Maj, 20:30, David Kahn wrote: > > On Tue, May 24, 2011 at 1:14 PM, Niklas Nson > wrote: > > > I think i have mislead you with the subject line of this post. > > > Its not that Peoples

Re: [Rails] Re: Can you use meta_search from diffrent models ?

2011-05-24 Thread David Kahn
gt; Right... metasearch is pretty magical but does not have psychic abilities :) > > /Niklas > > On 24 Maj, 18:51, David Kahn wrote: > > On Tue, May 24, 2011 at 10:54 AM, Niklas Nson >wrote: > > > > > Thanks for your reply - sadly i cant get it working. &g

Re: [Rails] Re: Can you use meta_search from diffrent models ?

2011-05-24 Thread David Kahn
t is post your current meta search code and the models you are trying to associate, and their associated schema (fields). > > On 24 Maj, 17:05, David Kahn wrote: > > On Tue, May 24, 2011 at 9:35 AM, Niklas Nson > wrote: > > > Im in love with meta_search, a

Re: [Rails] Can you use meta_search from diffrent models ?

2011-05-24 Thread David Kahn
On Tue, May 24, 2011 at 9:35 AM, Niklas Nson wrote: > Im in love with meta_search, a great gem but i have a question: when > using it in controllers wich has the same name as the model (Photo => > PhotosController) it workes like a charm. But i have a > PeoplesController for handling accounts, pr

Re: [Rails] An idea for new syntactic sugar in Ruby

2011-05-20 Thread David Kahn
On Fri, May 20, 2011 at 4:23 PM, Rob Biedenharn wrote: > On May 20, 2011, at 5:05 PM, Curtis j Schofield wrote: > > if notice = response_status_and_flash.delete(:notice) >>flash[:notice] = notice >> end >> >> > This is a common C idiom. > > The best solution is to always write your == with t

Re: [Rails] Duplicate RoR applications?

2011-05-20 Thread David Kahn
On Fri, May 20, 2011 at 3:45 PM, Mohamed L. wrote: > Hi, > > I have a simple question for when ruby on rails, say I want to create > two apps and I am currently working on one but essentially the other app > will need exactly the same things up to this stage can I just duplicate > the folder whic

[Rails] Re: update_attributes updates data from second instance of nested form but not the first

2011-05-20 Thread David Kahn
the other associations start to update correctly. On Thu, May 19, 2011 at 12:31 PM, David Kahn wrote: > Got a weird situation with an update put to a controller with a form with > nested attributes. > > On the data below, I am updating data for both items ('0' and '1') in &g

[Rails] update_attributes updates data from second instance of nested form but not the first

2011-05-19 Thread David Kahn
Got a weird situation with an update put to a controller with a form with nested attributes. On the data below, I am updating data for both items ('0' and '1') in rosters_attributes (in the example below I am updating the 'name' attribute to a new value in both cases. What I am stuck on is that '1

[Rails] Is it possible to populate a join table in a HABTM relationship via nested forms (accepts attributes for)?

2011-05-18 Thread David Kahn
High level, if I have the following two models with a join table, is it possible to create a nested form which would populate the join table. In this case, I would have a form for Roster with multiple nested forms for players_rosters (the join table). From what I see in playing with this and online

Re: [Rails] Best way to compute data from "old" records

2011-05-18 Thread David Kahn
On Wed, May 18, 2011 at 9:09 AM, Michel Pigassou wrote: > Hi. > > I'm looking for different point of views, or maybe a "state of the art" > view, for a technically simple question. > > I have many models that a user has the power to destroy, and I also want to > compute data from these models, ev

Re: [Rails] Disabling sessions for web crawlers

2011-05-17 Thread David Kahn
On Tue, May 17, 2011 at 2:32 PM, robinluc...@gmail.com < robinluc...@gmail.com> wrote: > I'm upgrading our Rails app from 2.1 to 2.3.11. Yes, this is > difficult. :-) > > Our application controller contains the following line: > >session :off, :if => Proc.new {|req| req.user_agent =~ BOT_REGEX

Re: [Rails] Can't dump File ... when uploading files

2011-05-17 Thread David Kahn
On Tue, May 17, 2011 at 4:01 PM, Erwin wrote: > I am getting this error on the redirect_to command ... > > I am using Rails 3 w Paperclip to upload files ( but I tried also > CarrierWave .. same error) > I tried to change the session store from cookie-based to database .. > same error > I tried

Re: [Rails] Re: has_many through question

2011-05-17 Thread David Kahn
schedule i want to enter > > > also some information to the model area. hope that makes sence. > > > thanks > > > ed > > > > So what are you stuck on? What problem are you looking to get an answer > for? > > > > B. > > > > > > >

[Rails] Select not maintaining state on nested form with

2011-05-17 Thread David Kahn
I am using nested forms with multiple instances of various of the forms. The problem I cant figure out is how to maintain state for the select between postbacks. I am using 'options_from_collection_for_select' and in this the last param is to be the selected value, but given the dynamic nature, the

Re: [Rails] has_many through question

2011-05-17 Thread David Kahn
On Tue, May 17, 2011 at 9:50 AM, eddyjab wrote: > hi there, > i thing i just have a logical problem. > > i have following models. > > class Area < ActiveRecord::Base >belongs_to :taskschedule >belongs_to :service > end > > class Service < ActiveRecord::Base >has_many :task

Re: [Rails] Help with 'new' form code - 'render' vs 'redirect_to'

2011-05-16 Thread David Kahn
make a variable visible for the whole class, not just the immediate method, you need to use @var (or another method). Think of the view as being in the same class as the controller but not inside the controller method. > > On Mon, May 16, 2011 at 1:51 PM, David Kahn > wrote: > >>

Re: [Rails] Help with 'new' form code - 'render' vs 'redirect_to'

2011-05-16 Thread David Kahn
On Mon, May 16, 2011 at 12:46 PM, Rodrigo Ruiz wrote: > if it has no knowledge of @user in the 'new' action, why do I need to do > @user = User.new? What is the point, if it will be lost for other actions? > > @user is used in @user = User.new so that you have your new user object available for th

Re: [Rails] PDF generator - Prawn and Prawnto.

2011-05-16 Thread David Kahn
On Mon, May 16, 2011 at 4:44 AM, jack kw wrote: > I'm quite confuse with prawn and prawnto. > is it must install prawn with prawnto to generate pdf ? > what prawnto does ? > Prawnto adds rails support for prawn such as a template handler (.prawn). I guess you could use prawn directly if you did

Re: [Rails] How to package a sub application in a gem

2011-05-15 Thread David Kahn
engine. This is a problem if you have, say, a model in your engine which you are intending to extend in your primary app and not the other way around. There is a way around this but just be aware. > > > On Sun, May 15, 2011 at 1:48 PM, David Kahn > wrote: > >> >> &g

Re: [Rails] Javascript/Ajax questions for rails applications

2011-05-15 Thread David Kahn
On Sun, May 15, 2011 at 12:20 PM, egervari wrote: > I am loving just about everything in rails right now. I find a lot of > things faster than java and it's a pleasure to work with. > > One area though that I am not sure how to proceed with is ajax/ > javascript. > > For those of you using rails

Re: [Rails] How to package a sub application in a gem

2011-05-15 Thread David Kahn
On Sun, May 15, 2011 at 12:33 PM, Martin Wawrusch wrote: > Hi guys, > I am rather new to the rails world and need your help in pointing me to a > good sample project and/or some hints how best to implement it. > > I have implemented an API section for a website of mine that deals with API > Key ma

Re: [Rails] Re: Rails 3 and saving decimal values from a form

2011-05-15 Thread David Kahn
On Sun, May 15, 2011 at 1:52 PM, Fernando Perez wrote: > > What would cause this? The database has the correct settings for the > > column and I can create a correct record using the rails console. > > The only column type that works is "decimal" is that your case? > > And gimme a link to your app

Re: [Rails] Re: Why is AR migrations using one file per migration?

2011-05-15 Thread David Kahn
On Sun, May 15, 2011 at 12:32 PM, Michael Pavling wrote: > On 15 May 2011 18:22, Nicolas Buduroi wrote: > > Yeah, while thinking about this, I realized how tiring it can be to > > search/consult/erase migrations files and I'm more and more sold to put > all > > migrations into one file. > > Why

Re: [Rails] Re: Why is AR migrations using one file per migration?

2011-05-15 Thread David Kahn
On Sun, May 15, 2011 at 11:35 AM, Nicolas Buduroi wrote: > Yes, that's about the worse drawback I had thought about, but this issue is > quite moot. One dev will only have to do a proper merge and that's it. Right. It is actually a really good question you raise, and yes a merge would not be any

Re: [Rails] Re: Why is AR migrations using one file per migration?

2011-05-15 Thread David Kahn
On Sun, May 15, 2011 at 11:53 AM, Nicolas Buduroi wrote: > On Sunday, May 15, 2011 12:44:08 PM UTC-4, DK wrote: >> >> Right. It is actually a really good question you raise, and yes a merge >> would not be any different than two devs who have modified any other file, >> git handles that gracefully

Re: [Rails] Re: Extending/reopeining class and use of super

2011-05-11 Thread David Kahn
On Wed, May 11, 2011 at 3:29 PM, Frederick Cheung < frederick.che...@gmail.com> wrote: > On May 11, 7:01 pm, David Kahn wrote: > > On Wed, May 11, 2011 at 12:52 PM, Frederick Cheung < > > > > frederick.che...@gmail.com> wrote: > > > > > On 11 May

Re: [Rails] Running Ruby/Rails Specs with database inserts from non-default spec sub-directory

2011-05-11 Thread David Kahn
On Wed, May 11, 2011 at 1:54 PM, egervari wrote: > Hi everyone! > > I have a question on how to setup my tests a bit differently than the > defaults. > > By default, Rails with RSpec installed provides you with directories > such as spec/models, spec/controllers, etc. > > When i use before(:each)

Re: [Rails] Re: Regex Validation

2011-05-11 Thread David Kahn
On Wed, May 11, 2011 at 10:26 AM, Fred Ballard wrote: > +1 to everything Walter has said, as well. > > I haven't thought about this a lot, but doesn't this apply to everything in > terms of user input? Doesn't this really enter the realm of a basic > guideline, principle, or law for UI? (I rememb

Re: [Rails] Extending/reopeining class and use of super

2011-05-11 Thread David Kahn
On Wed, May 11, 2011 at 12:52 PM, Frederick Cheung < frederick.che...@gmail.com> wrote: > > On 11 May 2011, at 18:17, David Kahn wrote: > > A question on a couple things relating to extending a class and the use of > super. > > In my main application I have the follo

Re: [Rails] help with validations

2011-05-11 Thread David Kahn
On Wed, May 11, 2011 at 2:36 AM, Quee WM wrote: > Hi, > > I am trying to use the new rails 3 validations and running into some > issues. > > for my password I have, > > validates :password,:presence => {:on => :create}, :length => { > :minimum => 5, :maximum => 16 }, :confirmation => true >

[Rails] Extending/reopeining class and use of super

2011-05-11 Thread David Kahn
A question on a couple things relating to extending a class and the use of super. In my main application I have the following class which extends an engine class: class User < ActiveRecord::Base def self.find_for_database_authentication(login_value, omniauth_provider=nil, omniauth_uid=nil)

Re: [Rails] requests hanging

2011-05-11 Thread David Kahn
imple and popular solution. > Thanks for sharing... I had not seen this and good to know about > > > > > > > On Tue, May 10, 2011 at 11:43 AM, Alex Katebi wrote: > >> >> >> On Tue, May 10, 2011 at 11:01 AM, David Kahn >> wrote: >> >>&g

[Rails] Re: Why is deep_symbolize_keys not available within application.rb (undefined method `deep_symbolize_keys' for Hash)

2011-05-10 Thread David Kahn
On Tue, May 10, 2011 at 12:37 PM, David Kahn wrote: > Ok, so it looks like I need ActiveSupport::CoreExtensions::Hash. A bit > confused as at the top of application.rb there is * require 'rails/all' *, > so I would think this should be included but is not. ActiveSupport

[Rails] Why is deep_symbolize_keys not available within application.rb (undefined method `deep_symbolize_keys' for Hash)

2011-05-10 Thread David Kahn
If there is a better way to do this I am open: I am trying to load a yaml config file which holds application settings (which happens to be shared between the main app and an engine). class Application < Rails::Application config_file = "#{Rails.root}/config/config.yml" if File.exists?(con

[Rails] Re: Why is deep_symbolize_keys not available within application.rb (undefined method `deep_symbolize_keys' for Hash)

2011-05-10 Thread David Kahn
everseMerge>, ActiveSupport::CoreExtensions::Hash::Slice<http://rubydoc.info/docs/rails/2.3.8/ActiveSupport/CoreExtensions/Hash/Slice> On Tue, May 10, 2011 at 12:31 PM, David Kahn wrote: > If there is a better way to do this I am open: I am trying to load a yaml > config file which hold

Re: [Rails] requests hanging

2011-05-10 Thread David Kahn
On Tue, May 10, 2011 at 10:43 AM, Alex Katebi wrote: > > > On Tue, May 10, 2011 at 11:01 AM, David Kahn > wrote: > >> >> >> On Tue, May 10, 2011 at 9:56 AM, David Kahn >> wrote: >> >>> >>> >>> On Tue, May 10, 2011 at 9:45

Re: [Rails] requests hanging

2011-05-10 Thread David Kahn
bly do it much more simply using a new thread. See: http://www.ruby-doc.org/core/classes/Thread.html > How long are we allowed to delay the sending of a respond? Is there a > better way do this in Rails way? This problem is intermittent. > > On Tue, May 10, 2011 at 10:29 AM, David Kahn &

Re: [Rails] requests hanging

2011-05-10 Thread David Kahn
On Tue, May 10, 2011 at 9:56 AM, David Kahn wrote: > > > On Tue, May 10, 2011 at 9:45 AM, Alex Katebi wrote: > >> I have restarted the server but not the computer. I am doing something >> abnormal. Off of a request I start some external program as sub processes. >>

Re: [Rails] requests hanging

2011-05-10 Thread David Kahn
On Tue, May 10, 2011 at 9:25 AM, Alex Katebi wrote: > > I see nothing any where. > To clarify, on your server terminal window, you see no output when you try to access a page? And of course the page does not load, I assume. It is probably not this if you are seeing nothing at all on the terminal

Re: [Rails] Beginners question | moving a method from controller to model

2011-05-08 Thread David Kahn
On Sun, May 8, 2011 at 12:00 PM, linda Keating wrote: > I'm learning with the Agile Web Development 4th edition book. I've > built a method in my controller to test that it works, and now I want to > move it to the model. > > *** line_item controller *** > **

Re: [Rails] Re: changing routes.rb

2011-05-07 Thread David Kahn
On Sat, May 7, 2011 at 9:27 PM, Mohamed L. wrote: > Hey, I'm trying to sort out the routing still, I've generated a home > controller, deleted the public/index.html and changed the routes.rb to > have :root to=> "home#index" and I have changed the html code in > app\view\home\index > > When I ope

Re: [Rails] Inflection working everywhere but not propogating to AR table name?

2011-05-07 Thread David Kahn
On Sat, May 7, 2011 at 3:03 PM, Michael Pavling wrote: > On 7 May 2011 20:56, David Kahn wrote: > > I agree I should be using 'datum' for the plural form > > Singular. > > "datum" is singular, "data" is plural > > > That aside, what is

Re: [Rails] Inflection working everywhere but not propogating to AR table name?

2011-05-07 Thread David Kahn
On Sat, May 7, 2011 at 2:51 PM, Frederick Cheung wrote: > > > On 7 May 2011, at 20:35, David Kahn wrote: > > I added this rule to inflections: > > inflect.uncountable 'data' > > My table name use to be AuthDatas and I want it to be AuthData. I migrated

[Rails] Inflection working everywhere but not propogating to AR table name?

2011-05-07 Thread David Kahn
I added this rule to inflections: inflect.uncountable 'data' My table name use to be AuthDatas and I want it to be AuthData. I migrated the db to change the table name and verified in the debugger that in fact "data".singularize and "data".pluralize == 'data'. But when I go to load the model: A

Re: [Rails] CAN'T HOST FILE UPLOAD SAMPLE APP ON HEROKU

2011-05-04 Thread David Kahn
On Wed, May 4, 2011 at 12:54 PM, ken bob wrote: > Hi, > After hosting my sample app for file upload on heroku using the FREE > account, it does not work properly. However, everything works fine on > my local machine. Please help > > FOR FILE UPLOAD:: > // controller.rb > def uploadFile > if p

Re: [Rails] Php to Ruby compilation software

2011-05-04 Thread David Kahn
On Tue, May 3, 2011 at 6:55 PM, femto Zheng wrote: > Hello, we just researched a Php to Ruby compilation software, > because our client has some Php Project, > and that can accelarates their transition to rails, > and there are a lot of php projects out there, both open sourced and close > source

Re: [Rails] Other way instead of this evil eval?

2011-05-03 Thread David Kahn
On Tue, May 3, 2011 at 2:33 PM, Michael Pavling wrote: > On 3 May 2011 20:30, Michael Pavling wrote: > > On 3 May 2011 20:26, David Kahn wrote: > >> record = > eval("#{associated_record_type}").find_by_id(associated_record_id) > >> > >> Is th

[Rails] Other way instead of this evil eval?

2011-05-03 Thread David Kahn
I am trying to do this, where associated_record_type is always of the name of a model, passed to the method: record = eval("#{associated_record_type}").find_by_id(associated_record_id) Is there a way to do this dynamically without using an eval? -- You received this message because you are sub

Re: [Rails] How TO deploy A Rails application on GoDaddy

2011-05-03 Thread David Kahn
On Tue, May 3, 2011 at 12:26 AM, rajeevkannav wrote: > Hello All > > I am new to deployment an rails application . i purchased web hosting plan > on go-daddy. and did the following stpes > I'm sure you dont want to hear this and forgive me if someone else already mentioned, but if you are startin

Re: [Rails] Re: an advice for search.

2011-05-01 Thread David Kahn
On Sun, May 1, 2011 at 5:15 PM, Phoenix Rising wrote: > +1 for meta_search, I <3 that thing > You know I almost cried the first time I used meta_search in the past I have written my own searches > > On May 1, 2:45 pm, Mauro wrote: > > On 1 May 2011 21:12, Carina Brito wrote: > > > > > Sorr

Re: [Rails] Re: One click two actions

2011-05-01 Thread David Kahn
our project. I am not sure about 'comprehensive', maybe a book? But you can definitely pick up what you need from the web but may be in pieces. > > On Apr 26, 8:29 pm, David Kahn wrote: > > On Tue, Apr 26, 2011 at 8:45 AM, johnlucas >wrote: > > > > > >

Re: [Rails] Testing download in controller

2011-04-30 Thread David Kahn
On Sat, Apr 30, 2011 at 8:14 AM, Jeffrey L. Taylor wrote: > How can download of files be tested? The processing of the file is being > tested okay, but I don't know how to simulate the controller call. > What are you using to test? This is a bit off your topic as it sounds like you are writing c

Re: [Rails] Best Rails environment for Windows 7

2011-04-30 Thread David Kahn
On Sat, Apr 30, 2011 at 7:36 AM, Ron Tsoref wrote: > First of all, thank you all for your suggestions. > I think I'll finally do the switch from Windows to Ubuntu. I wanted to do > it for a while, and I think it's a good time to do it now. > > Once I install Ubuntu, what should I do next? > > Goo

Re: [Rails] an advice for search.

2011-04-29 Thread David Kahn
On Fri, Apr 29, 2011 at 5:05 PM, Mauro wrote: > On 29 April 2011 23:52, David Kahn wrote: > > > > > > On Fri, Apr 29, 2011 at 4:41 PM, Mauro wrote: > >> > >> I have a Shop model with some attributes: > >> > >> role_number :integer(

Re: [Rails] an advice for search.

2011-04-29 Thread David Kahn
On Fri, Apr 29, 2011 at 4:41 PM, Mauro wrote: > I have a Shop model with some attributes: > > role_number :integer(10) > role_date :date > name :string(255) > ssn :string(255) > nationality :string(255) > address :string(255) > number:string(255) >

Re: [Rails] Re: Downloaded Ruby, where do I extract it to start?

2011-04-29 Thread David Kahn
On Fri, Apr 29, 2011 at 3:20 PM, Paul wrote: > What I would do is start with Ruby Version Manager (rvm). See if this works... you do need ruby installed to install rvm though. If you can run irb in the terminal then you should be on your way. If not you have to find a way to get ruby installed

Re: [Rails] Re: Downloaded Ruby, where do I extract it to start?

2011-04-29 Thread David Kahn
kage manager to install ruby and get it running then you are on the path. Just an fyi, you might want to look at rvm for managing multiple versions of ruby as well as being able to isolate rails installs. > > Fred > > > On Apr 29, 11:54 am, David Kahn wrote: > > On Fri, Apr 29, 20

Re: [Rails] Downloaded Ruby, where do I extract it to start?

2011-04-29 Thread David Kahn
On Fri, Apr 29, 2011 at 12:17 PM, fredrated wrote: > The reason I ask this elementary question is because when I originally > installed ruby and rails, after the so-called installation was > completed, many of the required files were found to be missing from > the 'install' directory (/usr/local/

Re: [Rails] Better-Model relation

2011-04-28 Thread David Kahn
On Thu, Apr 28, 2011 at 12:49 PM, David Kahn wrote: > > > On Thu, Apr 28, 2011 at 12:38 PM, santhiya wrote: > >> Hi, >> >> Can anybody suggest me better relationship among the above model. so that >> i can connect message model with other ones. >> >>

Re: [Rails] Better-Model relation

2011-04-28 Thread David Kahn
On Thu, Apr 28, 2011 at 12:38 PM, santhiya wrote: > Hi, > > Can anybody suggest me better relationship among the above model. so that i > can connect message model with other ones. > > I have four model like > > 1.User model - To store the user email and password > 2.Actor model > 3.Director mode

Re: [Rails] Best Rails environment for Windows 7

2011-04-27 Thread David Kahn
On Wed, Apr 27, 2011 at 8:26 AM, Chief wrote: > What is the best and easiest way of running Ruby on Rails on a Windows > 7 machine? > > Add a vm running Ubuntu and do your rails work on it. You will have more support than trying to deal with Windows, also, chances are you will be deploying to a L

Re: [Rails] Re: Can not create model instance via params on specific model but can on others....

2011-04-27 Thread David Kahn
On Wed, Apr 27, 2011 at 1:34 PM, Kendall Gifford wrote: > > > On Wednesday, April 27, 2011 12:25:28 PM UTC-6, DK wrote: >> >> Anyone have an idea on this? Got a weird situation where on a specific >> model I can not create an instance using params, yet it works fine on other >> models. The model w

[Rails] Can not create model instance via params on specific model but can on others....

2011-04-27 Thread David Kahn
Anyone have an idea on this? Got a weird situation where on a specific model I can not create an instance using params, yet it works fine on other models. The model which does not work is a stock model, there is no logic in it. Ruby 1.8.7/Rails 3.0.5. Does not work: (rdb:1) PaymentTransaction.cre

Re: [Rails] One click two actions

2011-04-26 Thread David Kahn
On Tue, Apr 26, 2011 at 8:45 AM, johnlucas wrote: > New to RoR here. I need to execute two actions with one click. > Basically when a link/button is clicked, I need to populate two > different div in the same page, both of them being two different > resources. I would like to do this in AJAX. > >

  1   2   3   4   5   >