[Rails] Re: csv import - encoding problem

2009-02-03 Thread bingo bob
anyone help with this. I'm not sure what's happening here. Maybe my data contains line feeds within the cells of data itself and that's throwing it out? Another thought is that I could go into numbers and do a find replace on the carriage return character...just not sure? What does this mean

[Rails] Re: How do I make an API for my rails app?

2009-02-03 Thread Tony Tony
I've done some quick searches on REST API as SOAP isn't recommended by the rails community. Came up with this site: http://hinchcliffe.org/archive/2008/01/10/16613.aspx I'll take a more in depth look later on. If anyone else has something to contribute, feel free! -Tony -- Posted via http

[Rails] update_attributes! does not update nested model

2009-02-03 Thread darkofabijan
Hi! I have updated my app to rails 2.3. I have form that has few nested models and I am happy that I can just write accepts_nested_attributes_for :tasks, :allow_destroy => true, but update_attributes! does not update my nested model. I have tried update_attributes, and it works. Any ideas? Few l

[Rails] Re: ActiveRecord problems after upgrade

2009-02-03 Thread Frederick Cheung
On 3 Feb 2009, at 14:05, Kenneth Dunlap wrote: > > > class Scode < ActiveRecord::Base >Scode.establish_connection(self::Conf) > end > > irb(main):001:0> require 'scode' > => true > irb(main):002:0> Scode > => Scode(Table doesn't exist) > irb(main):003:0> Scode.table_name > => "\e[4mScode\e[0m

[Rails] Re: Drop downs for new and edit

2009-02-03 Thread Frederick Cheung
On 3 Feb 2009, at 13:44, Qaiser Wali wrote: > >> Both of those are covered by the examples in the api docs I linked >> to. >> >> Fred > > Thanks for the help so far, but using this i am running into more > issues > that before, I am not getting the field name as i want it using > :field_name

[Rails] Re: Maxima and Ruby Integration

2009-02-03 Thread Andrius Chamentauskas
Hm I'm not sure why does it freeze. You could try max.to_a.last or if all else fails try just skipping unnecessary lines using while loop On Feb 3, 3:36 pm, Richard Schneeman wrote: > >> max = IO.popen("maxima", "w+") > => # > >> max.readlines.last > > ^CIRB::Abort: abort then interrupt!! >   fr

[Rails] Re: Help on File

2009-02-03 Thread Martijn Vos
On 3 Feb 2009, at 9:40 AM, Newb Newb wrote: > Martijn Vos wrote: > >> On 3 Feb 2009, at 7:37 AM, Newb Newb wrote: > > thanks for the reply. > ok if i put my folder in public > how can i open that file. Same way you'd load anything else in the public folder, like images or css files. Take a look

[Rails] Fixed set of values for an attribute and migrations

2009-02-03 Thread Juan Kinunt
Hi, I have a model with three attributes that could be a fixed set of different values. Each attribute does not have sufficient entity to be a class (in my opinion) and I prefer to not to create classes in order to store them. For example, one attribute can be only three strings: phone, email or f

[Rails] ActiveRecord problems after upgrade

2009-02-03 Thread Kenneth Dunlap
Hi I have a rather large project that uses ActiveRecord both with Rails, and separately in various scripts. All has been working well until I upgraded from version 2.0.2 to version 2.2.2. Now, ActiveRecord doesn't seem to be looking for the correct table. Here's an example of what I'm seeing.

[Rails] Re: copy column table before save

2009-02-03 Thread Franz Strebel
On Tue, Feb 3, 2009 at 2:52 PM, Petan Cert wrote: > > Hi, > > I would like to copy one column to another before it's saved. > > For example: > <% form ... %> > <%= %>f.text-field: about %> > <%= f.text-field: price %> > <% end %> > > Could I copy price to another table column before it is saved?

[Rails] copy column table before save

2009-02-03 Thread Petan Cert
Hi, I would like to copy one column to another before it's saved. For example: <% form ... %> <%= %>f.text-field: about %> <%= f.text-field: price %> <% end %> Could I copy price to another table column before it is saved? THank you. -- Posted via http://www.ruby-forum.com/. --~--~-~

[Rails] Re: How do I make an API for my rails app?

2009-02-03 Thread Tony Tony
Thanks for the replies Mukund, Julian, and Comopasta! @Mukund - I consider it to be a wonderful app ;-) I see this app being similar and no more complicated than twitterific or tweetie on the iphone. I'm thinking a SOAP/REST interface is what I will need. Also, the increased visibility of the

[Rails] Re: Drop downs for new and edit

2009-02-03 Thread Qaiser Wali
> Both of those are covered by the examples in the api docs I linked to. > > Fred Thanks for the help so far, but using this i am running into more issues that before, I am not getting the field name as i want it using :field_name to specify the vehicle[year_made] gives me date[vehicle[year_i

[Rails] Re: Maxima and Ruby Integration

2009-02-03 Thread Richard Schneeman
>> max = IO.popen("maxima", "w+") => # >> max.readlines.last ^CIRB::Abort: abort then interrupt!! from /opt/local/lib/ruby/1.8/irb.rb:81:in `irb_abort' from /opt/local/lib/ruby/1.8/irb.rb:243:in `signal_handle' from /opt/local/lib/ruby/1.8/irb.rb:66:in `start' from (irb):2:in `call' from

[Rails] Re: belongs_to / has_many does not save

2009-02-03 Thread bachm...@geo.uzh.ch
I 'renamed' the 'Transaction' model to 'Order' and voila: It works! thanks! nd On Feb 2, 6:42 pm, Frederick Cheung wrote: > On 2 Feb 2009, at 16:44, bachm...@geo.uzh.ch wrote: > > > > > Hi > > > I'm following pretty closely the following the Depot Application from > > the 'Agile Web Development

[Rails] Re: Drop downs for new and edit

2009-02-03 Thread Frederick Cheung
On 3 Feb 2009, at 13:03, Qaiser Wali wrote: > >> >> You could start by reading the api docs >> (http://api.rubyonrails.org/classes/ActionView/Helpers/DateHelper.html#M001677 >> ) >> >> Fred > > Thanks for this, now two more questions remain. > > I still need to have a custom value like -- Select

[Rails] Re: Passing args to generator

2009-02-03 Thread Ferenc-Lorant Kiss
Description: Generating list,edit,save and show partials for tasks from TrstSysTask table, based on 'exe_id' value. Convention: base_path /app/views/trst_sys (change with --controller_path) partial_path base_path/xxx/yyy/zzz/_*.html.erb with "./script/generate task_partial xxx_yyy_zzz" o

[Rails] Re: Drop downs for new and edit

2009-02-03 Thread Qaiser Wali
> > You could start by reading the api docs > (http://api.rubyonrails.org/classes/ActionView/Helpers/DateHelper.html#M001677 > ) > > Fred Thanks for this, now two more questions remain. I still need to have a custom value like -- Select -- added in there. And also for edit time, how do i m

[Rails] Re: Drop downs for new and edit

2009-02-03 Thread Frederick Cheung
On 3 Feb 2009, at 12:55, Qaiser Wali wrote: > >> On 3 Feb 2009, at 12:42, Qaiser Wali wrote: >> >> You could use select_year >> >> Fred > > I am sorry I do not know ruby as much so will need more help than > this. You could start by reading the api docs (http://api.rubyonrails.org/classes/Ac

[Rails] Re: Drop downs for new and edit

2009-02-03 Thread Qaiser Wali
> On 3 Feb 2009, at 12:42, Qaiser Wali wrote: > > You could use select_year > > Fred I am sorry I do not know ruby as much so will need more help than this. -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you ar

[Rails] Re: Drop downs for new and edit

2009-02-03 Thread Frederick Cheung
On 3 Feb 2009, at 12:42, Qaiser Wali wrote: > > I have a drop down in my forms. > > Year Manufactured The value needs to be from 1970 -- current year > > In the new form i am using the following code > > > -- Select -- > <%= options_from_collection_for_select((1970..Time.now.year).collect > {|p

[Rails] Drop downs for new and edit

2009-02-03 Thread Qaiser Wali
I have a drop down in my forms. Year Manufactured The value needs to be from 1970 -- current year In the new form i am using the following code -- Select -- <%= options_from_collection_for_select((1970..Time.now.year).collect {|p| [ p, p ] }, "first", "last") %> I want to be able to show the

[Rails] Re: nested resources , forms and update

2009-02-03 Thread Adam Akhtar
ahh i got confused between create and build. And the @task idea, dont know why i didnt think about that. Can i confirm that build doesnt actually add a blank task to @project but rather just returns one? Last im wondering how rest changes where i add code. In the above case when a user adds

[Rails] Sphinx Running problem

2009-02-03 Thread Chirag Shah
Hi, I have windows PC.First, i had install sphinx-0.9.8-win32.zip. and then add sphinx as plugin.and set sphinx.yml file in config/sphinx.yml my sphinx.yml is as below config file:: config/#{environment}.sphinx.conf searchd log file:: log/searchd.log query log file:: log/searchd.query.lo

[Rails] Help needed regarding Yahoo autocomplete UI in rails

2009-02-03 Thread Ruhul Amin
HI guys, I have a tag field in my rails app. I want to add auto complete option in tag input field by yahoo UI. I have googled a lot but nothing found workable. Here is the best one that I found from net but by protype. http://genlinux.blogspot.com/2008/07/prototype-ui

[Rails] Re: Controller design for app with different user types

2009-02-03 Thread Joey Ar
Hey Eric, Thanks a lot for the links. The first one was really useful as that addresses overlapping permissions for various roles and my application, I suppose, falls in that domain. As for the views, yes they are radically different for each type of user. The app brings different types of us

[Rails] Re: nested resources , forms and update

2009-02-03 Thread Ryan Bigg
Do @task = @project.tasks.build and use that as the fields_for argument On 03/02/2009, at 21:37, Adam Akhtar wrote: > > Hi I have nested resources i.e. projects which have many tasks and a > task belongs to a project. > > In my project show view I show project info i.e. title and description

[Rails] does ActiveScaffold support multiple joins? (i.e. in the ":joins => ..." part of a find)

2009-02-03 Thread Greg Hauptmann
Hi, Does ActiveScaffold support multiple joins? (i.e. in the ":joins => ..." part of a find). Can't quite seem to see how to make it work (e.g. passing an array in for the :joins parameter didn't seem to work).If it is possible would you be able to drop in an example? (that is I'm talking

[Rails] Re: nested has_many :through - does Rails supported this at the moment? it seems not

2009-02-03 Thread Greg Hauptmann
thanks 2009/2/3 MaD : > > i've seen / read those discussions as well (and found it pretty > interesting), but afaik until now it's not a rails feature. last time > i checked it didn't work for me either. > > sorry. > > > -- Greg http://blog.gregnet.org/ --~--~-~--~~~-

[Rails] button_to Problem

2009-02-03 Thread Shilo Ayalon
I'm having a similar problem with button_to and button_to_remote - I'm trying to set the action to submit through: <%= button_to 'update', { :action => "update", :id => product.id } %> Regardless, the button's action points to /products/:id as the html shows: Why?.. -- Posted via

[Rails] csv import - encoding problem

2009-02-03 Thread bingo bob
I'm trying to load a CSV file into my rails app using a migration and FasterCSV and running into problems. I've had this working before when the CSV file has been saved out of excel, I'd like to do it with numbers now but I can't quite get it to work as is. I can't believe that excel does a bette

[Rails] Re: nested has_many :through - does Rails supported this at the moment? it seems not

2009-02-03 Thread MaD
i've seen / read those discussions as well (and found it pretty interesting), but afaik until now it's not a rails feature. last time i checked it didn't work for me either. sorry. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Go

[Rails] nested resources , forms and update

2009-02-03 Thread Adam Akhtar
Hi I have nested resources i.e. projects which have many tasks and a task belongs to a project. In my project show view I show project info i.e. title and description and then list all the tasks associated with it. I want to have a simple non-javascript form which allows a user to add a new task

[Rails] nested has_many :through - does Rails supported this at the moment? it seems not

2009-02-03 Thread Greg Hauptmann
Hi, Can someone clarify whether Rails current support nested has_many, :through? For example: has_many :business_items, :through => :ai_allocations has_many :bi_allocations, :through => :business_items # 2nd one here references a previous ":through" I've seen discussion on blogs re suppo

[Rails] Re: Maxima and Ruby Integration

2009-02-03 Thread Andrius Chamentauskas
What about readlines.last? On Feb 1, 7:40 pm, Richard Schneeman wrote: > Thanks that did the trick. Do you know if there is an easy way to get > the last result, or everything without having to do so many "gets"? I > tried .each and readlines but with not much success. Or at least a way > to det

[Rails] Re: ActiveRecord can validates "select" querys?

2009-02-03 Thread Daniel López
The fact is that the project I'm developing is a database connection API and, although is not essential, it would be nice that it could checks the data integrity. The reason for do that is to improve the user (or programmer :P) experience and prevent potential errors in the final application,

[Rails] Re: File Iteration

2009-02-03 Thread MaD
try this Dir.foreach(RAILS_ROOT + '/public/javascripts') do |filename| puts filename end --~--~-~--~~~---~--~~ 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

[Rails] Re: File Iteration

2009-02-03 Thread Newb Newb
Frederick Cheung wrote: > On 3 Feb 2009, at 10:43, Newb Newb wrote: > >> >> Hi all... >> i have folder named test in my application's public folder . >> i want to iterate that folder named test which is in public folder. >> for that i tried this code it gives me error like >> > What code :-) ? Di

[Rails] Re: File Iteration

2009-02-03 Thread Frederick Cheung
On 3 Feb 2009, at 10:43, Newb Newb wrote: > > Hi all... > i have folder named test in my application's public folder . > i want to iterate that folder named test which is in public folder. > for that i tried this code it gives me error like > What code :-) ? Dir.each, Dir.glob, Dir.entries can a

[Rails] Re: Query some part on each record.

2009-02-03 Thread Frederick Cheung
On 3 Feb 2009, at 07:48, MaD wrote: > > i don't wann disappoint, but i think you'll have to query the whole > entry "very long contents" and cut off the tail. > > GetsomePart.Big_Row[0..3] > > if anyone knows a better solution (one that offers more performance), > let me know. Well I don't kno

[Rails] Re: Query some part on each record.

2009-02-03 Thread Colin Law
You could have another column in the table, containing the short version. 2009/2/3 Ukrit Himakoon > > MaD wrote: > > i don't wann disappoint, but i think you'll have to query the whole > > entry "very long contents" and cut off the tail. > > > > GetsomePart.Big_Row[0..3] > > > > if anyone know

[Rails] File Iteration

2009-02-03 Thread Newb Newb
Hi all... i have folder named test in my application's public folder . i want to iterate that folder named test which is in public folder. for that i tried this code it gives me error like Errno::ENOENT in Chat logController#chat_log No such file or directory - /public/ACMServer_exe/ChatH

[Rails] Re: How do I make an API for my rails app?

2009-02-03 Thread comopasta Gr
> So being close to release I started thinking of neat things I could do, > like making an iphone app. I haven't tried making my own iphone app yet > and don't look too forward to it honestly. So I was thinking of making > an API for my rails app and let others with more experience than me give >

[Rails] Passing args to generator

2009-02-03 Thread Ferenc-Lorant Kiss
I have some default_options in generator and when I wish to change they value with --option_name I get only logical true instead of string ... default_options :option_name => "Some string" ... def add_options!(opt) opt.separator '' opt.separator 'Options:' opt.on("--option_name","Some Text")

[Rails] generated plugin test doesn't work

2009-02-03 Thread Raphael Bauduin
Hi, I'm on rails 2.2.2, and generate a new plugin: ./script/generate plugin mytest and try to run the generated test but get an error: cd vendor/plugins/mytest/ rake test --trace (in /tmp/test/vendor/plugins/mytest) ** Invoke test (first_time) ** Execute test /usr/bin/ruby1.8 -Ilib:lib:test "

[Rails] Re: From : Newb! {ADVICE_NEEDED}

2009-02-03 Thread Genocide Law
Oh.. okay.. thanks a lot lol. I'll keep that in mind. =D -- 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 ru

[Rails] protect to_xml and/or disabled other format

2009-02-03 Thread fmh
hello, how protect to_xml and disabled other format or accpet only html format example : if user type in url www.mysite/controller.xml , i want to redirect to another controller. it's possible to use a routes to do that ? --~--~-~--~~~---~--~~ You received this me

[Rails] Ruby on Rails Day @ JAX India 2009 Conference

2009-02-03 Thread 2009jax
This year at the JAX India 2009 conference, sda-india.com promises to stage some JAX India Specials that have never been thought of before. Introducing for the very first time at JAX India 2009 is JAX University Day and Ruby on Rails Day. Ruby on Rails Day at the JAX India 2009 conference would s

[Rails] Re: Help on File

2009-02-03 Thread Newb Newb
pls kindly help me up. -- 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

[Rails] Re: Help on File

2009-02-03 Thread Newb Newb
pls kindly help me up. -- 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 T

[Rails] Re: Query some part on each record.

2009-02-03 Thread Ukrit Himakoon
MaD wrote: > i don't wann disappoint, but i think you'll have to query the whole > entry "very long contents" and cut off the tail. > > GetsomePart.Big_Row[0..3] > > if anyone knows a better solution (one that offers more performance), > let me know. Thx , Mad :D Any other solution? :) -- Po

[Rails] Re: Ruby EE: Problem with BigDecimal

2009-02-03 Thread Carsten Gehling
Small discovery: 1) The problem begins after the application has run for a period of time, e.g ½ hour. 2) If I do a "touch tmp/restart.txt" the problem disappears - only to resurface again later So I think something is "bottling up" inside the application. When it happens, it concerns ALL Big

[Rails] Re: Validation - Credit Card Validation

2009-02-03 Thread Cyrus Dev
Hello Thanks , is also do payment gateways processsing ? this plugin ? -- 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,

[Rails] Re: how to get datetime_select params?

2009-02-03 Thread Hasitha Dewapriya
Patrick Aljord wrote: > On 10/26/06, Cayce Balara wrote: >> >> I think it would be: >> >> @dateregister = params[:user][:registered_after] >> > sorry that was a typo, this is what I do @dateregister = > params[:user][:registered_after] but I get nil. any idea why? I do not know whether this is

[Rails] Re: Validation - Credit Card Validation

2009-02-03 Thread Ramon Tayag
I doubt anyone will give step-by-step instructions but checkout active merchant gem. I've found the active merchant pdf in peepcode to be quite helpful. Ramon Tayag On Tue, Feb 3, 2009 at 4:47 PM, Cyrus Dev wrote: > > Hello Everyone > > any one know how to validate credit card information in

[Rails] Validation - Credit Card Validation

2009-02-03 Thread Cyrus Dev
Hello Everyone any one know how to validate credit card information in rails ? please help me thanks in advance -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on R

[Rails] Re: Help on File

2009-02-03 Thread Newb Newb
Martijn Vos wrote: > On 3 Feb 2009, at 7:37 AM, Newb Newb wrote: thanks for the reply. ok if i put my folder in public how can i open that file. -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are subscribed

[Rails] Re: Help on File

2009-02-03 Thread Martijn Vos
On 3 Feb 2009, at 7:37 AM, Newb Newb wrote: > when i use below code to open a google page it works. > > onClick="window.open('http:// > www.google.com','mywindow','width=400,height=200')"> > > But i have html file in my application folder.to open that file i > tried > this Code. > > onClick

[Rails] Ruby EE: Problem with BigDecimal

2009-02-03 Thread Carsten Gehling
I have a strange problem with my setup of Passenger and Ruby Enterprise Edition. Sometimes the loading of BigDecimals from the database and session fails (silently) and the variable containing the BigDecimal is just empty. I cannot pinpoint where/when/how it happens, and it IS only periodic. I

[Rails] Re: Rails 2.2 Integration tests cookie store

2009-02-03 Thread Zaphod Beeblebrox
Ok the good configuration for Session store une database by ActiveRecord is : class ActionController::RackRequest DEFAULT_SESSION_OPTIONS = { :database_manager => CGI::Session::ActiveRecordStore, :cookie_only => false, :session_http_only=> true } end Add this c

[Rails] Re: Help on File

2009-02-03 Thread Julian Leviston
Before you do rails driven sites work out about how webservers work first. Blog: http://random8.zenunit.com/ Learn rails: http://sensei.zenunit.com/ On 03/02/2009, at 6:01 PM, Newb Newb wrote: > > Julian Leviston wrote: >> What do you want it to do? What is the path supposed to load? >> >> B

<    1   2