[Rails] Date parsing.

2011-05-19 Thread Mauro
I'm inmporting a csv file and I have strings like this: 15-OTT-98, 5-GEN-96. They are dates: OTT stands for Oct in italian and GEN stands for Jan. How can I render those strings in valid date format? -- You received this message because you are subscribed to the Google Groups Ruby on Rails:

Re: [Rails] Date parsing.

2011-05-19 Thread Peter De Berdt
On 19 May 2011, at 10:24, Mauro wrote: I'm inmporting a csv file and I have strings like this: 15-OTT-98, 5-GEN-96. They are dates: OTT stands for Oct in italian and GEN stands for Jan. How can I render those strings in valid date format? # Note: my Italian is very rusty to non-existent,

Re: [Rails] Date parsing.

2011-05-19 Thread Mauro
On 19 May 2011 09:04, Peter De Berdt peter.de.be...@pandora.be wrote: On 19 May 2011, at 10:24, Mauro wrote: I'm inmporting a csv file and I have strings like this: 15-OTT-98, 5-GEN-96. They are dates: OTT stands for Oct in italian and GEN stands for Jan. How can I render those strings in

Re: [Rails] Date parsing.

2011-05-19 Thread Peter De Berdt
On 19 May 2011, at 11:17, Mauro wrote: Ok. Can I create past that method inside a custom rake task and use it inside the namespace? Ex: /lib/tasks/import.rake def parsedatestring(datestring) day, monthname, year = datestring.split(-) year = (year.to_i Date.today.year - 2000 ? 19#{year}

[Rails] rails 3 and postgresql scemas

2011-05-19 Thread sleepwalker
Does Rails 3 support native working with postgresql schemas, or I should try some own solution? I have some already-created postgresql database with 4 or somth schemas. By putting schema_search_path: ejabber, public, admin, statistic into database.yml I told Rails that I have more than 1 schema.

[Rails] Re: controllers in sub-directories without namespaces?

2011-05-19 Thread John W
On May 18, 5:16 pm, PsiPro arjes...@gmail.com wrote: Since it looks like your making a storefront I would suggest looking at Spree's ERD for inspiration. (http://rails-erd.rubyforge.org/images/ spree.png) Brian, both Spree and ERD are very helpful. I hadn't come across them before. Thanks!

[Rails] Re: controllers in sub-directories without namespaces?

2011-05-19 Thread John W
On May 18, 8:56 pm, Kendall Gifford zettab...@gmail.com wrote: Any chance you'd be willing to list some of the gems that aren't working with your setup? It might be in yours and everyones best interest to try to fix get the gems themselves fixed so they can properly work with nested

[Rails] Phusion Passenger for Intranet?

2011-05-19 Thread frankblizzard
Hi, we have a mac osx server in the intranet where i want to host my rails application. I installed successfully passenger on the machine. Now when I am working on the server, I can access the rails app through the url, e.g. test.local But when I put the same URL in the browser in one of the

Re: [Rails] Phusion Passenger for Intranet?

2011-05-19 Thread Peter De Berdt
On 19 May 2011, at 12:32, frankblizzard wrote: we have a mac osx server in the intranet where i want to host my rails application. I installed successfully passenger on the machine. Now when I am working on the server, I can access the rails app through the url, e.g. test.local But when I

[Rails] Module in Rails

2011-05-19 Thread News Aanad
Hi, I want to use module in Rails 3 I have module in /lib directory. file name: my_module.rb Code of Module: module MyModule def self.my_method loop do puts I am started!!! sleep 2 end end end Now, I want to use this module in my rb file resides in

[Rails] Re: rake db:create = LIBMYSQL.DLL not found. how to solve?

2011-05-19 Thread Ritesh Kumar
For further details about this issue, refer to the post - http://rorguide.blogspot.com/2011/03/installing-mysql2-gem-on-ruby-192-and.html This along with many other issues of mysql2 gem has already been solved by many users and they have posted their solutions also. Thanks Ritesh Kumar

[Rails] Re: Phusion Passenger for Intranet?

2011-05-19 Thread frankblizzard
Hi Peter, thanks for your reply. BTW, why would you run Apache or nginx on port 3000 when you can just   run everything on the same webserver? I don't have apache running on 3000 - it have Webbrick still running there so the clients can reach the rails app, but I want to deploy it via

[Rails] Re: How to make a deep copy of ActiveRecord

2011-05-19 Thread Francis Fish
I think the question's more about creating a new record that has all of the relationships? All the Marshal trick does is create an identical copy. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk

[Rails] Simple check_box

2011-05-19 Thread Eric M.
Hello, I'm trying create a simple check_box that if checked include a hidden_field, but I haven't success. Something like this: p class=field/p %= check_box_tag(:patrono, value = 1, checked = false, options = {}) % %= f.label Patrono % % if :patrono.checked == true % %=

[Rails] Paperclip Gem Successfully Installed? If yes its doesn't seem to detect via IRB..

2011-05-19 Thread Mohnish J.
Hi, I am trying to install a paperclip gem using the command `gem install paperclip-2.2.0.gem` . This doesn't work for me.. it keeps giving me the error.. mohnish@mohnish-desktop:~/Downloads/Important_backups/new_gems/paperclip$ gem install paperclip-2.2.0.gem ERROR: While executing

[Rails] Re: [Form Helpers] Collection_select multiple and accepts_nested_attributes_for

2011-05-19 Thread Eric M.
Try this: %= collection_select(:taggings, :tag_ids, Tag.find(:all), :id, :name, {}, {:multiple = true}) % -- 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

Re: [Rails] Re: Phusion Passenger for Intranet?

2011-05-19 Thread Peter De Berdt
On 19 May 2011, at 14:07, frankblizzard wrote: BTW, why would you run Apache or nginx on port 3000 when you can just run everything on the same webserver? I don't have apache running on 3000 - it have Webbrick still running there so the clients can reach the rails app, but I want to deploy

[Rails] NoMethodError (undefined method `serializable_record' for #ActiveModel

2011-05-19 Thread Lucky Nl
Hi , Am using rails 3 .I have added code in my controller --- la.map{|c| ActiveRecord::Base::Serializer.new(c).serializable_record --- But am getting below error

[Rails] Form_for submit to a different table

2011-05-19 Thread Dave Castellano
Can anyone point me in the right direction... I have created a page using a form_for which pulls from question' table. I would like to submit answer data to student_data table. I can't figure out how to submit specific fields to the alternate table. f.submit uses the table specified by

[Rails] Re: Tailing Error

2011-05-19 Thread Saravanan Krishnan
Yes Michael you are right... Mohammed, You can achieve this by using git bash...(git command line). Just google it for git installation for windows. For multiple tab support you can use console2. One of the coolest features is the ability to plug-in any shell. So you can even configure it to

[Rails] Re: Form_for submit to a different table

2011-05-19 Thread Saravanan Krishnan
DC, Try this, http://www.railsforum.com/viewtopic.php?id=717 Use form_tag instead form_for Saravanan K http://bit.ly/9NpP7e -- 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

[Rails] Re: Simple check_box

2011-05-19 Thread Saravanan Krishnan
Eric, You have to write javascript function within the check_box_tag in order to verify whether the checkbox is checked or not and then enable the hidden field if it is checked. Saravanan K http://bit.ly/9NpP7e -- Posted via http://www.ruby-forum.com/. -- You received this message because

Re: [Rails] Re: Committing files uploaded by the user to GIT?

2011-05-19 Thread Jen
Hi, Thanks for the suggestions. I've restructured my application a bit, but am running in to problems with 'repo' not being defined in the controller. I'm actually a bit confused about where the method to commit the files should go. My thinking is that it should be in the model (as that

Re: [Rails] Simple check_box

2011-05-19 Thread Tom Meinlschmidt
hi, use jQuery and then = f.hidden_field_tag hidden_field, value, { :id = hidden_field} = f.check_box_tag name, 1,false, {:id = my_checkbox} jQuery('#my_checkbox').bind('click', function() { jQuery('#hidden_field').attr('disabled', !jQuery(this).attr('checked')); } when field is disabled,

[Rails] how can i index the sum of tow attributes with thinking sphinx ?

2011-05-19 Thread heithem nouira
i have option model with this structure: Class Option ActiveRecord::Base has_one :base_price, :class_name = OptionPrice, :conditions = {:base = true} define_index do indexes base_price.provider_price, :as = :p_base_price indexes base_price.margin_price, :as = :m_base_price

[Rails] How to test mobile devices and mobile mime types

2011-05-19 Thread Alpha Blue
Hi All, I just started incorporating a mobile MIME format into my websites to account for mobile phone technologies visiting my pages. I decided to share a functional controller test for requesting the mobile mime type and asserting if it finds a particular div selector. This test case can be

[Rails] Cookie Overflow at CSV import

2011-05-19 Thread Sebastian
Hi I have a form for importing a csv file. With every entry in my CSV I do a delayed background call from a webservice and the result is then saved to my database. This is working great! Now I tried a CSV file with over 400 rows. After clicking import in my form it takes some time and then I get

[Rails] Re: How to test mobile devices and mobile mime types

2011-05-19 Thread Alpha Blue
Adding an example for show.mobile.erb for a user model so that you don't encounter any gotchas. This is using the same example from above: setup do @user = users(:testuser) end test should get show.mobile.erb do @request.accept = mobile get :show, :id = @user.to_param, :format = 'mobile'

[Rails] rspec-core-2.6.1 is released!

2011-05-19 Thread David Chelimsky
rspec-core-2.6.1 is released! This is a bug fix release, restoring integration with with rcov. full changelog: http://github.com/rspec/rspec-core/compare/v2.6.0...v2.6.1 * Bug fixes * Don't extend nil when filters are nil * `require 'rspec/autorun'` when running rcov. -- You received this

[Rails] Unable to find the image path via file system using the paperclip plugin through the get method

2011-05-19 Thread Mohnish G j
Hello all, with great difficulty , I guess I have finally been able to find the appropriate git commit of paperclip which would suit my project's config which is Ruby 1.8.7 and rails 2.0.2. I am trying to implement a POC before I integrate paperclip in my project. The POC is basically

[Rails] Re: rails 3 and postgresql scemas

2011-05-19 Thread Kendall Gifford
First a disclaimer: I'm no expert on using PostgreSQL w/rails. So, take this with a grain of salt. Hopefully someone w/more knowledge will respond. On Thursday, May 19, 2011 3:46:29 AM UTC-6, sleepwalker wrote: Does Rails 3 support native working with postgresql schemas, or I should try some

[Rails] Re: Module in Rails

2011-05-19 Thread Kendall Gifford
On Thursday, May 19, 2011 5:15:29 AM UTC-6, News Aanad wrote: Hi, I want to use module in Rails 3 I have module in /lib directory. I'm going to assume by /lib you mean RAILS_ROOT/lib ... file name: my_module.rb Code of Module: module MyModule def self.my_method loop do

[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

[Rails] Form to handle Array type

2011-05-19 Thread Alex Katebi
Is there a form to handle Array type? I generated a scaffold for a model that has Array for a field type. But the partial form does not handle this type. How do we tie Array types to forms? Thanks, Alex -- You received this message because you are subscribed to the Google Groups Ruby on

[Rails] Form to handle Array type

2011-05-19 Thread Alex Katebi
Is there a form to handle Array type? I generated a scaffold for a model that has Array for a field type. But the partial form does not handle this type. How do we tie Array types to forms? Thanks, Alex -- You received this message because you are subscribed to the Google Groups Ruby on

[Rails] undefined method `name' for “SystemTimer”:String

2011-05-19 Thread sean n.
Hey All, I am having a problem getting an old Ruby on Rails 2 app that hasn't worked in a year to work. I'm trying to run rake test:functionals in the root of my project directory but am getting undefined method `name' for SystemTimer:String I've pasted everything that I believe relevant to the

[Rails] Re: Phusion Passenger for Intranet?

2011-05-19 Thread frankblizzard
Hi, thank you very much for taking the time to give this detailed answer. I will go through it through the weekend in detail as I want to be able to administrate these things myself. I'll let you know how it goes.. frank BTW, why would you run Apache or nginx on port 3000 when you can just

[Rails] Re: undefined method `name' for “SystemTimer”:String

2011-05-19 Thread Kendall Gifford
On Thursday, May 19, 2011 3:41:22 PM UTC-6, Ruby-Forum.com User wrote: Hey All, I am having a problem getting an old Ruby on Rails 2 app that hasn't worked in a year to work. I'm trying to run rake test:functionals in the root of my project directory but am getting undefined method `name'

Re: [Rails] Form to handle Array type

2011-05-19 Thread Walter Lee Davis
What kind of values are you storing in your array? This may be the sort of thing you need to roll yourself. Walter On May 19, 2011, at 5:38 PM, Alex Katebi alex.kat...@gmail.com wrote: Is there a form to handle Array type? I generated a scaffold for a model that has Array for a field

Re: [Rails] Form to handle Array type

2011-05-19 Thread Alex Katebi
I am storing email addresses. On Thu, May 19, 2011 at 6:21 PM, Walter Lee Davis wa...@wdstudio.com wrote: What kind of values are you storing in your array? This may be the sort of thing you need to roll yourself. Walter On May 19, 2011, at 5:38 PM, Alex Katebi alex.kat...@gmail.com wrote:

[Rails] Re: RMagick installed BUT no such file to load -- RMagick

2011-05-19 Thread Cedric de La Beaujardiere
I had the same problem, and found the solution here, by Peturrr: http://ubuntuforums.org/showthread.php?t=306216 --- Do _not_ use: sudo gem install rmagick Peturrr solved this by uninstalling the gem and installing the precompiled rmagick ubuntu package from the universe repos.:

[Rails] 3 Questions about devise

2011-05-19 Thread egervari
Hi, I've just gotten started with devise and it's pretty nifty. I just wondered if people could point me in the right direction for finding info about 3 things. 1. How come the login form does not report error messages when the username/password is incorrect? I generated the views and replaced

[Rails] How to deploy Rails app on my laptop

2011-05-19 Thread Karthikeyan A k
Hello People, I have created a tiny Rails app for my personal use. I want to host it on my personal computer (just like PHP can be hosted easily). I use Ubuntu Linux, can any one tell me how to do it? Is there any documentation? Has any one tried it out? Thanks in advance. -- Posted via

Re: [Rails] How to deploy Rails app on my laptop

2011-05-19 Thread Walter Lee Davis
This is easily done, if you consider Install Apache; gem install passenger; gem install passenger-apache; follow post install config instructions to be easy. Walter On May 19, 2011, at 8:03 PM, Karthikeyan A k li...@ruby-forum.com wrote: Hello People, I have created a tiny Rails app for

[Rails] Re: How to deploy Rails app on my laptop

2011-05-19 Thread elitwin
On May 19, 5:13 pm, Walter Lee Davis wa...@wdstudio.com wrote: This is easily done, if you consider Install Apache; gem install passenger; gem install passenger-apache; follow post install config instructions to be easy. I would just run passenger standalone (using Nginx) -- You received

[Rails] How to wait for response

2011-05-19 Thread renu mehta
I am trying to write an application which uses screen scraping. I have to first get a screen and get then scrape that page and using the link to a frame in that page, I have to get that frame and then finally scrape that frame and get some relevant information. When I make the first call in the

[Rails] How to handle non model data in form?

2011-05-19 Thread Heinz Strunk
Hey, I got a form which looks like this: - form_for(@article, :html = {:multipart = true}, :url = articles_path) do |f| = errors_for(@article) .field = f.label :text %br = f.text_field :text .field = f.label :author_id %br = f.text_field :author_id .actions