Re: [Rails] newbie question on rails 3

2011-04-27 Thread Colin Law
On 26 April 2011 23:35, femig georgef...@gmail.com wrote: hello, i have a basic rails 3 question.. i have a list of jobs in my db and each job is tied to a particular location..in short i have one location to many jobs.. i have created scaffolding for jobs and locations and created the

[Rails] We're sorry, but something went wrong.

2011-04-27 Thread Sira PS
I'm learning about Paperclip: Attaching Files in Rails, following this link http://jimneath.org/2008/04/17/paperclip-attaching-files-in-rails.html I place these code to display image on show.html.erb %= image_tag @user.photo.url % %= image_tag @user.photo.url(:thumb) % On new page, I browse a

[Rails] How to add flex project to rails project?

2011-04-27 Thread Sira PS
I'm starting to learn in flex and ruby on rails. I see some projects there is a flex folder which contains controller, models, views. I think it's not mannually to add these folders to rails project. How to do that? -- Posted via http://www.ruby-forum.com/. -- You received this message

[Rails] Re: ActionMailer Layouts for Rails 2.1.1

2011-04-27 Thread cipher_neo
nice one mate On Apr 26, 11:41 am, Frederick Cheung frederick.che...@gmail.com wrote: On Apr 26, 11:10 am,cipher_neol33...@gmail.com wrote: Hi guys, I am using rails 2.1.1 on a project and would like to enable mailer layouts for it. I know that in later versions of rails, this is

Re: [Rails] We're sorry, but something went wrong.

2011-04-27 Thread radhames brito
this line of the tutorial could be outdated has_attached_file :photo, :path = :rails_root/public/:class/:attachment/:id/:style_:basename.:extension see paperclip's documention to see if is still valid -- You received this message because you are subscribed to the Google Groups Ruby on

[Rails] Re: Validations in the same Model

2011-04-27 Thread Junior Grossi
Thanks! I will try do something like that. []s On Apr 26, 7:43 pm, Philip Hallstrom phi...@pjkh.com wrote: Thanks for your reply. I read about STI and solve my problem. BUT now I have another hehe. I have 2 validations rules, because I have a has_one association. How can I do this?

[Rails] Re: Jasper reports and iReport

2011-04-27 Thread vincent vincent
Jon Garvin wrote in post #629004: On Feb 6, 3:51 am, FlexRails her...@intermatics.be wrote: If anyone is interested let me know and I will post some additional information on how I got it to work. Yes, Please! One day you got it work, and today i try to have it !!! Do you remember how you

[Rails] Create and save nested data

2011-04-27 Thread Sebastian
Hi, I am working on a patent database, where the user can first search the patent database and then save the found patent with connected patents (called familymembers). So I have a page called patent where the search is done and all values that I need for the database are available. From that

[Rails] Re: Create and save nested data

2011-04-27 Thread Sebastian
OK, I don't know why but it happens all the time that after posting a problem in a forum I am able to solve the problem, nearly!!! I think I was really on the wrong track! Now I added the following code in my patent view: %params = {:watchedfamily = {:Prio_No = 66, :title = Please,

[Rails] Rake 0.8.7 issue on Rails 3, ruby 1.9.2 and Windows 7

2011-04-27 Thread Darlan Machado
Hi folks, I´ve posted some days ago and receive your support. First i wish to thank you. I have this environment (Ruby 1.9.2, Rails 3.0.7, rake 0.8.7 ans MySQL 5.5.9 on Windows 7 32 bits) and another running on Ubuntu 9.10 (the versions of Ruby, rails, rake and MySQL are the same). So, i am able

[Rails] Re: NoMethodError in Book

2011-04-27 Thread amrit pal pathak
On Apr 26, 8:35 am, amrit pal pathak amritpalpath...@gmail.com wrote: On Apr 26, 7:53 am, Frederick Cheung frederick.che...@gmail.com wrote: On 26 Apr 2011, at 12:28, amrit pal pathak amritpalpath...@gmail.com wrote: On Apr 26, 5:55 am, Frederick Cheung

Re: [Rails] Re: Create and save nested data

2011-04-27 Thread Walter Davis
On Apr 27, 2011, at 9:44 AM, Sebastian wrote: OK, I don't know why but it happens all the time that after posting a problem in a forum I am able to solve the problem, nearly!!! I think I was really on the wrong track! Now I added the following code in my patent view: %params =

[Rails] Re: Create and save nested data

2011-04-27 Thread Sebastian
OK again I got it: %= button_to Show, :controller = watchedfamilies, :action = create, :watchedfamily = {:Prio_No = X5x5x5x5, :title = Please, :watchedmembers_attributes = [{:Pub_No = yyy1}, {:Pub_No = zzz2}]} % On 27 Apr., 15:44, Sebastian sebastian.go...@googlemail.com wrote: OK, I don't

[Rails] Re: Rake 0.8.7 issue on Rails 3, ruby 1.9.2 and Windows 7

2011-04-27 Thread Luis Lavena
On Apr 27, 10:49 am, Darlan Machado li...@ruby-forum.com wrote: Hi folks, I´ve posted some days ago and receive your support. First i wish to thank you. I have this environment (Ruby 1.9.2, Rails 3.0.7, rake 0.8.7 ans MySQL 5.5.9 on Windows 7 32 bits) and another running on Ubuntu 9.10 (the

[Rails] rspec - Could not find generator rspec_controller

2011-04-27 Thread Sergio Ruiz
for some reason, i cannot get the rspec generators to work. i am getting the following: $ rails generate rspec_controller Could not find generator rspec_controller. the rest of the parts of rspec (that i am familiar with) seem to be doing just fine. i am running: * rails (3.0.5) * rspec

[Rails] Re: Routing Error

2011-04-27 Thread amrit pal pathak
very strange again !! say_controller.rb looks like: class SayController ApplicationController def hello @timee =Time.now end def goodbye end end /app/view/say/hello.html.erb looks like: It is now %= @timee% a href=/say/goodbyeGoodbye/a

[Rails] Re: rspec - Could not find generator rspec_controller

2011-04-27 Thread Robert Walker
Sergio Ruiz wrote in post #995322: for some reason, i cannot get the rspec generators to work. i am getting the following: $ rails generate rspec_controller Could not find generator rspec_controller. the rest of the parts of rspec (that i am familiar with) seem to be doing just fine. i

[Rails] Re: rspec - Could not find generator rspec_controller

2011-04-27 Thread Sergio Ruiz
perfect! 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

[Rails] Re: Routing Error

2011-04-27 Thread Pale Horse
amritpal p. wrote in post #995323: class SayController ApplicationController def hello @timee = Time.now end def goodbye end end /app/views/say/hello.html.erb looks like: It is now %= @timee % a href=/say/goodbyeGoodbye/a Instead of a href=/say/goodbyeGoodbye/a, use %=

[Rails] Re: NoMethodError in Book

2011-04-27 Thread amrit pal pathak
Awaiting your helpful reply!! -- 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

[Rails] Rails doesn't populate dynamic generated fields on error on posting

2011-04-27 Thread adnan khan
In our raols application we have a page where upon submit we save data in db. On this page, we have some fields which are dynamically generated and I see that in case of a validation error when page reloads it doesn't populate these fields with the values present upon posting. In controller we

[Rails] Re: what does :new = {:start = :get} mean in routes?

2011-04-27 Thread Max Reznichenko
Hi, John Obviously map.resources :sessions, :member = {:validate = :get}, :new = {:start = :get}, :only = %w(create new) creates new route for you like the one you have in new method redirect_to start_new_session_path and return if current_user If you had map.resources :sessions, :member =

[Rails] additional authentication logic in devise

2011-04-27 Thread femig
hello, please how and where can i place additional authentication logic in devise? i have added a custom column called expire_date in my users table and it is a date column. i want an additional requirement that the date there must not be later than todays date before allowing them to be

[Rails] Best Rails environment for Windows 7

2011-04-27 Thread Chief
What is the best and easiest way of running Ruby on Rails on a Windows 7 machine? I really want to learn Rails, but I haven't found any easy way of installing it on Windows 7. -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to

Re: [Rails] Best Rails environment for Windows 7

2011-04-27 Thread jason white
this is the best way to get setup on Windows http://www.railsinstaller.org/ On Wed, Apr 27, 2011 at 8:26 AM, Chief chie...@gmail.com wrote: What is the best and easiest way of running Ruby on Rails on a Windows 7 machine? I really want to learn Rails, but I haven't found any easy way of

[Rails] paperclip plugin

2011-04-27 Thread Mlle
Hi, Is it possible to have a file uploader in my form using the paperclip plugin that doesn't correspond to a model attribute? For example, I want to be able to upload a file for a model but name it using the model's id - then when I retrieve the file, I'll just use the id to get the file's

[Rails] Re: NoMethodError in Book

2011-04-27 Thread Pale Horse
amritpal p. wrote in post #995333: Awaiting your helpful reply!! You've already got an answer - your '@book' method is undefined in the 'new' action of your controller. You need to define '@book' in 'new' before you can access it. When an object such as a variable is undefined, it will

[Rails] Re: Validations in the same Model

2011-04-27 Thread Junior Grossi
Just to complete the topic... solved! Solution: validates_presence_of :name, :tel_commercial, :tel_mobile, :address, :city, :state, :neighborhood, :if = :representative? def representative? lambda {|p| p.representative.present?} end Thanks philip! []s On Apr

[Rails] rubygems (LoadError)

2011-04-27 Thread Sayem Islam
I'm trying to set up a cron job with a runner that calls a method in one of my models. I'm using javan's whenever gem to do this and I'm running CentOS on my server. Whenever the cron executes though I'm getting the following error: `require': no such file to load -- rubygems (LoadError) The

[Rails] Fwd: easy eclipse configuration

2011-04-27 Thread Mitin Rai
..? -- Forwarded message -- From: Mitin Rai mitin...@gmail.com Date: Tue, Apr 26, 2011 at 11:12 PM Subject: easy eclipse configuration To: rubyonrails-talk@googlegroups.com hi i am trying to use easyeclipse for rails... can somebody help me configure this

[Rails] Re: We're sorry, but something went wrong.

2011-04-27 Thread Sira PS
I already check with there website, has_attached_file is still valid. https://github.com/thoughtbot/paperclip#readme -- 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

[Rails] Re: problem populating table using rake db:fixtures:load

2011-04-27 Thread jdq
I discovered that Rails 3 apparently needs the whole file name specified, i.e., it should be FIXTURES=stores.yml On Apr 26, 12:20 pm, jdq d...@quirkeweb.net wrote: I'm running Rails 3 and I'm trying to populate a table using rake db:fixtures:load, and I'm getting a Could not find file error.

Re: [Rails] rubygems (LoadError)

2011-04-27 Thread Frederick Cheung
On 27 Apr 2011, at 17:24, Sayem Islam li...@ruby-forum.com wrote: I'm trying to set up a cron job with a runner that calls a method in one of my models. I'm using javan's whenever gem to do this and I'm running CentOS on my server. Whenever the cron executes though I'm getting the following

[Rails] Rails and PHP scripts

2011-04-27 Thread AL
Hi, I'm quite new with Ruby On Rails. I have working Rails 3 environment with Apache / Passenger and Devise authentication. Everything is working fine but I have one question. I have some GIS (maps) webservices and those services are implemented with PHP -mapscript. I have to use PHP in those GIS

[Rails] Re: 'bignum too big to convert into long' while migration in rails

2011-04-27 Thread Kendall Gifford
On Tuesday, April 26, 2011 11:36:10 PM UTC-6, Ruby-Forum.com User wrote: While i run rake db:migrate i got below error ,let me know any one . Please it is urgent to me. D:\raj\tweasierrake db:migrate --trace (in D:/raj/tweasier) DEPRECATION WARNING: Rake tasks in

[Rails] Re: rubygems (LoadError)

2011-04-27 Thread Sayem Islam
Frederick Cheung wrote in post #995357: How is ruby installed on your server? Fred Thanks for the response, Fred. When I run the method within terminal it works with no problem, I'm just getting these gem issues with cron. ruby -v shows the following: ruby 1.9.2p180 (2011-02-18 revision

[Rails] Search and Filter application

2011-04-27 Thread Daniel Amsterdam
Hello all, i'm starting a new application and as i'm quite new to rails i want to ask some advise to start this application. I'm planning to create an application with a search and filter function (like a search for real estate application) if the user selects an option i want to count the

[Rails] Re: Rails and PHP scripts

2011-04-27 Thread Kendall Gifford
On Wednesday, April 27, 2011 10:18:03 AM UTC-6, AL wrote: Hi, I'm quite new with Ruby On Rails. I have working Rails 3 environment with Apache / Passenger and Devise authentication. Everything is working fine but I have one question. I have some GIS (maps) webservices and those services

[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)

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

2011-04-27 Thread Kendall Gifford
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 which does not work is a stock model, there is no logic in it.

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 zettab...@gmail.comwrote: 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.

Re: [Rails] Re: rubygems (LoadError)

2011-04-27 Thread Jason Stover
On Wed, Apr 27, 2011 at 12:39 PM, Sayem Islam li...@ruby-forum.com wrote: Thanks for the response, Fred. When I run the method within terminal it works with no problem, I'm just getting these gem issues with cron. ruby -v shows the following: ruby 1.9.2p180 (2011-02-18 revision 30909)

[Rails] Fighting Rails RESTful Routes Conventions

2011-04-27 Thread Kevin Monceaux
Rails Fans, Back in the 2.x days I converted my personal site to Rails. I eventually got tired of fighting Rails conventions and tried other options. I'm now back and giving Rails another look. I've been tinkering with another personal site and have it partially implemented in both Rails 3 and

[Rails] Re: Fighting Rails RESTful Routes Conventions

2011-04-27 Thread Tim Shaffer
I don't think you'll find much information about that. REST is one of the core principles of Rails. It can probably be done by hacking parts of ActionDispatch/Routing/Mapper, or by writing a gem to do so. I also think the default routes make a lot of sense... The way I see it - if you were to

[Rails] Re: Re: rubygems (LoadError)

2011-04-27 Thread Sayem Islam
Jason Stover wrote in post #995372: PATH (make sure cron can find all the binaries it needs), LANG (make sure the encoding is the same, en_US is crons default IIRC, and it may need en_US.utf8), RUBYOPT, RAILS_GEM_VERSION, GEM_HOME, GEM_PATH It may be a good idea to run

Re: [Rails] Re: Re: rubygems (LoadError)

2011-04-27 Thread Jason Stover
On Wed, Apr 27, 2011 at 2:40 PM, Sayem Islam li...@ruby-forum.com wrote: I'm not getting that anymore, however now I'm getting the following SQLException when using cron: runner.rb:50:in `eval': SQLite3::SQLException: no such table: users: SELECT users.* FROM users

[Rails] Can't configure cach_store in an initializer

2011-04-27 Thread Jack Chu
I'm trying to use redis-store as my cache_store. I also have an app_confirg.rb initalizer which loads a yaml file for config settings. In my redis.rb initializer I have: MyApp::Application.config.cache_store = :redis_store, APP_CONFIG['redis'] However, this doesn't appear to work. If I do

Re: [Rails] Re: Fighting Rails RESTful Routes Conventions

2011-04-27 Thread Kevin Monceaux
On Wed, Apr 27, 2011 at 12:36:06PM -0700, Tim Shaffer wrote: The way I see it - if you were to create a folder on your computer to store recipies, what would you call it? Recipe or recipes? I'd create a directory, and call it Recipes. I'd call it recipes since it holds more than one

Re: [Rails] Re: Fighting Rails RESTful Routes Conventions

2011-04-27 Thread Kevin Monceaux
On Wed, Apr 27, 2011 at 03:08:50PM -0500, Kevin Monceaux wrote: In that context, which of: /Recipes/Beef-Brisket /Recipe/Beef-Brisket After sending my last reply, I thought of another way of looking at the above URLs. Using slugs and Rails plural default, and my CamelCase preferences,

[Rails] Find the radio buttons selected in a page

2011-04-27 Thread anusha v.
I have a survey taking page with a set of questions. Each question has five radio buttons. After answering the questions user clicks submit. Then based on the selection the values must be updated in the table called results. Each row in the results table represents a unique radio button. the

Re: [Rails] Best Rails environment for Windows 7

2011-04-27 Thread Alex Katebi
Install Ubuntu 10.10 on Windows using wubi.exe. It does not require partitioning your disk. And it can be easily removed. On Wed, Apr 27, 2011 at 9:26 AM, Chief chie...@gmail.com wrote: What is the best and easiest way of running Ruby on Rails on a Windows 7 machine? I really want to learn

Re: [Rails] Best Rails environment for Windows 7

2011-04-27 Thread David Kahn
On Wed, Apr 27, 2011 at 8:26 AM, Chief chie...@gmail.com 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

[Rails] Re: Re: Re: rubygems (LoadError)

2011-04-27 Thread Sayem Islam
Jason Stover wrote in post #995384: Hrmm if your database is correct, then I'd say be sure to pass the correct RAILS_ENV paramater to cron like: * * * * * /usr/bin/env RAILS_ENV=development /usr/local/bin/ruby [path to]/somescript.rb -J You're the man, Jason. Thanks a lot! That

Re: [Rails] Re: Fighting Rails RESTful Routes Conventions

2011-04-27 Thread Paul
I don't think it matters if the conventions make sense or not. If possible, you should try to use them for the following reasons: 1) If another programmer who is familiar with Rails starts maintaining your site, they will be annoyed that they have to figure out what you did instead of already

[Rails] Re: Can't configure cach_store in an initializer

2011-04-27 Thread Jack Chu
I've also tried putting it in an after_initialize block and this doesn't seem to work either. config.after_initialize do config.cache_store = :redis_store, APP_CONFIG['redis'] end -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post

[Rails] Net::HTTP end of file reached

2011-04-27 Thread Erwin
Doing a check on a remote file url, using Net::HTTP, I get an 'end of file reached' here is the Ruby code (1.9.2) [env ; Rails3 , webrick ] url = URI.parse(URI.escape(test_upload.videoUrl)) req = Net::HTTP::Head.new(url.path) res = Net::HTTP.start(url.host, url.port) {|http|

Re: [Rails] Net::HTTP end of file reached

2011-04-27 Thread Bryan Crossland
On Wed, Apr 27, 2011 at 6:11 PM, Erwin yves_duf...@mac.com wrote: Doing a check on a remote file url, using Net::HTTP, I get an 'end of file reached' here is the Ruby code (1.9.2) [env ; Rails3 , webrick ] url = URI.parse(URI.escape(test_upload.videoUrl)) req =

[Rails] Re: Best Rails environment for Windows 7

2011-04-27 Thread Luis Lavena
On Apr 27, 6:28 pm, David Kahn d...@structuralartistry.com wrote: On Wed, Apr 27, 2011 at 8:26 AM, Chief chie...@gmail.com 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

Re: [Rails] Re: Fighting Rails RESTful Routes Conventions

2011-04-27 Thread Phil Crissman
Phil On Wed, Apr 27, 2011 at 3:46 PM, Kevin Monceaux ke...@rawfeddogs.netwrote: On Wed, Apr 27, 2011 at 03:08:50PM -0500, Kevin Monceaux wrote: In that context, which of: /Recipes/Beef-Brisket /Recipe/Beef-Brisket After sending my last reply, I thought of another way of looking at

[Rails] Re: Routing Error

2011-04-27 Thread amrit pal pathak
On Apr 27, 10:52 am, Pale Horse li...@ruby-forum.com wrote: amritpal p. wrote in post #995323: class SayController ApplicationController  def hello   @timee = Time.now  end  def goodbye  end end /app/views/say/hello.html.erb looks like: It is now %= @timee % a

[Rails] Strange behavior

2011-04-27 Thread Ernesto Rocha
Guys, I'm using some AJAX on my application, but when protect_from_forgery is on sometimes it works and sometimes the user session is killed. Today i found out why. It happens the following: The authenticity_token is sent correctly as you can see below, Started DELETE

Re: [Rails] Re: We're sorry, but something went wrong.

2011-04-27 Thread radhames brito
sorry i meant you should check that you can still pass :rails_root/public/:class/:attachment/:id/:style_:basename.:extension instead of Rails.root.join -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email

[Rails] Re: NoMethodError in Book

2011-04-27 Thread amrit pal pathak
On Apr 26, 8:35 am, amrit pal pathak amritpalpath...@gmail.com wrote: On Apr 26, 7:53 am, Frederick Cheung frederick.che...@gmail.com wrote: On 26 Apr 2011, at 12:28, amrit pal pathak amritpalpath...@gmail.com wrote: On Apr 26, 5:55 am, Frederick Cheung

[Rails] Re: Re: We're sorry, but something went wrong.

2011-04-27 Thread Sira PS
Radhames Brito wrote in post #995446: sorry i meant you should check that you can still pass :rails_root/public/:class/:attachment/:id/:style_:basename.:extension instead of Rails.root.join Thank you for your response. I checked as you told me and I found that it pass to

Re: [Rails] Re: Fighting Rails RESTful Routes Conventions

2011-04-27 Thread David Paschich
I'll chime in on this thread a little -- As someone learning Rails, the most frustrating thing is not that these conventions exist - it's that it's very hard to figure out what those conventions _are_ through anything but experimentation and banging one's head against it. This is where I

[Rails] Re: Rails 3 Crashing On Windows 7

2011-04-27 Thread cipher_neo
I am going to tackle this problem this weekend, I've been really busy this week and havn't had a chance to try out your fix. thanks for the reply On Apr 21, 1:51 pm, Luis Lavena luislav...@gmail.com wrote: On Apr 21, 5:08 am, cipher_neo l33...@gmail.com wrote: I had a lot of issues at the