[Rails] Re: how to write an binary file to ftp

2009-11-07 Thread Guo Yangguang
ftp api itself has binary mode ,but not support writing file which itself is initially binary data? -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk"

[Rails] I am looking for RoR Webrat Selenium Install Recipe

2009-11-07 Thread Audrey A Lee
Hi there, I'm trying to follow the ch 22 of the RSpec book. [ copy is (B11.0 printing, October 28, 2009) ] I want to use selenium and cucumber. Ordinary webrat seems to be working well. Here is info about my RoR: Sat Nov 07 21:53 /pt/tt11 maco$ Sat Nov 07 21:53 /pt/tt11 maco$ Sat Nov 07 21:5

[Rails] how to write an binary file to ftp

2009-11-07 Thread Guo Yangguang
Net::FTP#putbinaryfile(binary_file, remotefile) binary_file is not a local file from some directory,but a dynamic generation from codes. The above codes not work,how to write it to ftp? -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received

[Rails] link_to_remote with image_tag using Paperclip

2009-11-07 Thread blueHandTalking
I am creating a layout of images with links. In Photo model: has_attached_file :mainimg, :styles => {:original => "465x365", :thumb => "80x70"} In my Front controller: def index @photos = Photo.find(:all) @photos = Photo.paginate :per_page => 28, :page => params[:page] end

[Rails] Re: Multiple Model Form

2009-11-07 Thread eggie5
my deal is even simpler than this though... The above like makes a series of models under a parent model.. I just want the series of parent models... On Nov 8, 9:38 am, Eric wrote: > mandatory viewing:http://railscasts.com/episodes/73-complex-forms-part-1 > > you'll probably benefit from watchin

[Rails] Re: Custom Validations Altering Variable

2009-11-07 Thread Marnen Laibow-Koser
7H3LaughingMan wrote: > Haven't really created any "proper" tests since I actually only have > one controller at the moment and I can test it via browser Not an excuse. You should write tests before writing any application code at all. That way you know your code does what you meant it to. Re

[Rails] Re: Custom Validations Altering Variable

2009-11-07 Thread 7H3LaughingMan
Haven't really created any "proper" tests since I actually only have one controller at the moment and I can test it via browser. All of my methods work however whenever I do an update it doesn't touch the set method to change the variable. (Tested with simple outputing text to say that it was bein

[Rails] Re: Custom Validations Altering Variable

2009-11-07 Thread Marnen Laibow-Koser
7H3LaughingMan wrote: > I don't know how it fails but for some reason it refuses to update > when I edit it, I have it setup to where it goes back to the index > when you successfully edit something and when it doesn't work it goes > back to the edit page. It doesn't even throw any error messages.

[Rails] Rio + Rake

2009-11-07 Thread Nash
Hi, I'm using RIO (http://rio.rubyforge.org/) in some of my models and it seems like Rake doesn't like it very much. The two conflict with each other. Has anyone figured out how to have RIO work as expected in rake? Thanks. -Nash --~--~-~--~~~---~--~~ Yo

[Rails] Re: Learning ruby on Mac - rake create error

2009-11-07 Thread dan
i was using sqlite for the past few projects and getting things running smoothly enough recently getting macports, git, installing a git module; geokit turns out geokit has more functionality in mysql / postgress then sqlite, namely distancing functions i create the project as mysql, scaffold a l

[Rails] Re: Custom Validations Altering Variable

2009-11-07 Thread 7H3LaughingMan
I don't know how it fails but for some reason it refuses to update when I edit it, I have it setup to where it goes back to the index when you successfully edit something and when it doesn't work it goes back to the edit page. It doesn't even throw any error messages. On Nov 7, 3:30 pm, Marnen La

[Rails] Re: First App- Error 500

2009-11-07 Thread Sam Sam
mgpowers wrote: > Does anyone have any ideas on this ? > > I hate to abandon Ruby but the error... > > /!\ FAILSAFE /!\ Wed Aug 26 10:40:18 -0400 2009 > Status: 500 Internal Server Error > unknown error > C:/Ruby/lib/ruby/1.8/dl/import.rb:29:in `initialize' > C:/Ruby/lib/ruby/1.8/dl

[Rails] Re: Multiple Model Form

2009-11-07 Thread Eric
mandatory viewing: http://railscasts.com/episodes/73-complex-forms-part-1 you'll probably benefit from watching all of them. -eric On Nov 7, 3:31 pm, eggie5 wrote: > I created scaffolding for my Model x, but I want to modify the new > view so that I can create multiple (3) x objects in the DB

[Rails] Re: mini_magick - 2 clarifications

2009-11-07 Thread doug
> It's a Ruby thing.  Can be tough to get used to Yep. I understand and definitely agree that it's a bit tough to get used to. The thing is, when the option to use parens when they're not required is exercised (as in lines 1 and 3 of this example) and then, for no apprent reason, the option is

[Rails] Multiple Model Form

2009-11-07 Thread eggie5
I created scaffolding for my Model x, but I want to modify the new view so that I can create multiple (3) x objects in the DB instead of just 1 at a time. How can I do this? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Gro

[Rails] Re: table inheritance in rails

2009-11-07 Thread Todd A. Jacobs
On Fri, Nov 06, 2009 at 01:23:25AM +0100, Aljaz Fajmut wrote: > human table: id weight size > person table: id name surname address If I understand your question correctly, you need to build the right relationships. If you lived in the Star Trek universe, you might have: class Person < Act

[Rails] Re: partials in rails

2009-11-07 Thread Marnen Laibow-Koser
Todd A. Jacobs wrote: > On Sat, Nov 07, 2009 at 01:03:37PM +0100, Aashish Kiran wrote: > > >> I am new to rails. can anyone explain in detail about partials in >> rails. my rails version is 2.3.4. How to use them? > > Partials are basically "includes." The tricky part is generally getting > var

[Rails] Re: Custom Validations Altering Variable

2009-11-07 Thread Marnen Laibow-Koser
7H3LaughingMan wrote: > Alright I have set it all up and it will convert it to the lowest form > (and back for debugging purposes), however whenever I try to edit and > save using @armor.update_attributes(params[:armor]) it fails for some > reason. Fails in what way? > Here is a link to show yo

[Rails] Re: Where to save temp data?

2009-11-07 Thread Colin Law
2009/11/6 Heinz Strunk : > > Marnen Laibow-Koser wrote: >> >> If it's only one request cycle, there's no real need to save temp data. >> What are you trying to do? >> > That's exactly my problem, otherwise I would be using variables. It's > many request cycles going back and forth that's why I nee

[Rails] Re: partials in rails

2009-11-07 Thread Todd A. Jacobs
On Sat, Nov 07, 2009 at 01:03:37PM +0100, Aashish Kiran wrote: > I am new to rails. can anyone explain in detail about partials in > rails. my rails version is 2.3.4. How to use them? Partials are basically "includes." The tricky part is generally getting variables from the main view to propaga

[Rails] Re: Custom Validations Altering Variable

2009-11-07 Thread 7H3LaughingMan
Alright I have set it all up and it will convert it to the lowest form (and back for debugging purposes), however whenever I try to edit and save using @armor.update_attributes(params[:armor]) it fails for some reason. Here is a link to show you what I did with the model... http://pastebin.com/me

[Rails] Re: how to params from a method to partial in rails

2009-11-07 Thread Aashish Kiran
Colin Law wrote: > 2009/11/7 Aashish Kiran : >> >> hi, >> can anyone tell how to pass params to a partial. >> -- > > As Leonardo Mateo pointed out in your other thread, > http://guides.rubyonrails.org/layouts_and_rendering.html#using-partials > should help. > > I presume you have already worked

[Rails] Re: how to params from a method to partial in rails

2009-11-07 Thread Artem Korolev
render :partial => 'some_partial', :locals => {:need_in_partial => @recived_from_controller} 2009/11/7 Colin Law > > 2009/11/7 Aashish Kiran : > > > > hi, > > can anyone tell how to pass params to a partial. > > -- > > As Leonardo Mateo pointed out in your other thread, > http://guides.rubyonrai

[Rails] wrong argument type Mysql (expected Struct) running rake with Ruby 1.9 / Rails 2.3.3

2009-11-07 Thread Paul Barry
I'm use Ruby 1.9 via rvm and Rails 2.3.3. I'm on OS X 10.5 and I have the mysql 2.8.1 gem installed. When I run rake on my rails app, I get the error "wrong argument type Mysql (expected Struct)". I can run the app fine with script/server and script/console fine. Is anyone else having this pro

[Rails] Re: Custom Validations Altering Variable

2009-11-07 Thread Eric
I don't agree. Best, Eric On Nov 7, 10:22 am, Marnen Laibow-Koser wrote: > Eric wrote: > > I would put this in a callback in the controller. I suggest starting > > at before_save and go from there. > > That would work, but I think it's conceptually wrong for what the OP > wants. > > > -eric > >

[Rails] Re: Choose a directory path

2009-11-07 Thread Matt Jones
On Nov 6, 11:07 pm, Salil Gaikwad wrote: > > Save a file where? On the server's filesystem or the client's? Not > > much info in this question... > > > --Matt Jones > > Hi Matt, > > I want to save file at Client's System. > The most reliable way to get a file to download every time (regardless

[Rails] Re: Custom Validations Altering Variable

2009-11-07 Thread Marnen Laibow-Koser
Eric wrote: > I would put this in a callback in the controller. I suggest starting > at before_save and go from there. > That would work, but I think it's conceptually wrong for what the OP wants. > -eric Best, -- Marnen Laibow-Koser http://www.marnen.org mar...@marnen.org -- Posted via http:

[Rails] Re: Custom Validations Altering Variable

2009-11-07 Thread Eric
I would put this in a callback in the controller. I suggest starting at before_save and go from there. -eric On Nov 7, 8:05 am, 7H3LaughingMan wrote: > I would like to know if it is possible to alter a variable during the > process of a custom validation. I know that it is no longer validation

[Rails] Re: Using will_paginate with arbitrary sql queries

2009-11-07 Thread mike
You also could use paginate_by_sql 2009/11/7, C K Kashyap : > > Hi All, > I have a situation where I have a task model, tag model and a link > table task_tags. > > In a particular view, I need to display a list of task that have a > certain tags - > For this, I'd need to run a query and get the r

[Rails] Re: Where to save temp data?

2009-11-07 Thread Hassan Schroeder
On Sat, Nov 7, 2009 at 12:49 AM, Heinz Strunk wrote: > No, user doesn't leave. It just could end up in many request cycles. > Didn't have the Session a very small amount of data it can save? That depends on how you're handling sessions, but the more I think about it, I'd just go with the Form o

[Rails] Re: new column in ActiveRecord object, method_missing() called intermittently

2009-11-07 Thread mike
It returns nil when you use joins or includes on your finds. Try records.sort_by_distance_from origin. That will add the distance column back 2009/11/6, jenna_s : > > Hi, > > I'm using the geokit plugin to provide a "find-locations-on-radius" > feature in my app. When a location is added to the d

[Rails] Re: Custom Validations Altering Variable

2009-11-07 Thread Marnen Laibow-Koser
7H3LaughingMan wrote: > I would like to know if it is possible to alter a variable during the > process of a custom validation. I know that it is no longer validation > when your altering data but in my opinion there are times when you > need alter it for simplicity sakes. That's not what validat

[Rails] polymorph associations

2009-11-07 Thread Terracor
Hello! I'm quite new to the rails framework and I just discovered the different kind of associations in models. For the application I'm creating, I need some polymorph associations. The model I created, works great. Now I need to create some views for editing the objects with these associations.

[Rails] Re: how to handle my comment validation errors

2009-11-07 Thread mike
Either you render the resort show action if your create fails or you use ajax to update only the comment part of your view. 2009/11/6, bingo bob : > > I've got a resorts view, shows details of a ski resort. Under the resort > description I allow users to leave comments on the resort - works fine.

[Rails] Re: Cookie and JSON request

2009-11-07 Thread mike
Use cookies[:name] = whatever in your response action 2009/11/6, Jens MF : > > HI: I want to make a JSON GET request and have a 'setCookie' entry in > the http response header. By default there is none. > How can I enable cookies with JSON? > > -Jens > > > > -- Von meinen Mobilgerät aus gesende

[Rails] Custom Validations Altering Variable

2009-11-07 Thread 7H3LaughingMan
I would like to know if it is possible to alter a variable during the process of a custom validation. I know that it is no longer validation when your altering data but in my opinion there are times when you need alter it for simplicity sakes. A good example would be for a world wide auction house

[Rails] Re: Running C processes, where do I put the C file?

2009-11-07 Thread Marnen Laibow-Koser
Victor Martin wrote: > Frederick Cheung wrote: > >> What the current directory is might depend on how you start the app, >> but in general it is the top level of your app. Either chdir to the >> folder containing your binary, use an absolute path or specify the >> path relative to the current dir

[Rails] Re: Running C processes, where do I put the C file?

2009-11-07 Thread Victor Martin
Frederick Cheung wrote: > What the current directory is might depend on how you start the app, > but in general it is the top level of your app. Either chdir to the > folder containing your binary, use an absolute path or specify the > path relative to the current directory. > > > Fred Oh, I f

[Rails] Re: Question about updating files in production / Mongrel re

2009-11-07 Thread Marnen Laibow-Koser
MJFuzz wrote: > Hello, > > I just completed my first real rails application. I successfully > deployed it, configured apache/mongrel clusters, etc. However, I do > need to make code changes on the site often. Just checking: you are using decent version control, right? > I noticed the only time

[Rails] Re: mini_magick - 2 clarifications

2009-11-07 Thread Rick
Paren use is optional except when required to disambiguate, i.e. when method1 takes two args and the first is method2 (which takes one or two args) you would use parens to group method2's args. It's a Ruby thing. Can be tough to get used to if you're coming from a c background and are used to th

[Rails] Re: Running C processes, where do I put the C file?

2009-11-07 Thread Frederick Cheung
On Nov 7, 12:24 pm, Victor Martin wrote: > Hi there > > I make a call jsut like this: > > value = `./simulated_annealing` > > Which is a C Object file, but Rails tells me it cannot find that file. I > put it in the same dir that the rest of the models files (since it's > called by one of those

[Rails] Re: how to params from a method to partial in rails

2009-11-07 Thread Colin Law
2009/11/7 Aashish Kiran : > > hi, > can anyone tell how to pass params to a partial. > -- As Leonardo Mateo pointed out in your other thread, http://guides.rubyonrails.org/layouts_and_rendering.html#using-partials should help. I presume you have already worked through the Getting Started guide.

[Rails] how to params from a method to partial in rails

2009-11-07 Thread Aashish Kiran
hi, can anyone tell how to pass params to a partial. -- 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 rubyon

[Rails] Re: partials in rails

2009-11-07 Thread Leonardo Mateo
On Sat, Nov 7, 2009 at 9:03 AM, Aashish Kiran wrote: > > I am new to rails. can anyone explain in detail about partials in rails. > my rails version is 2.3.4. > How to use them? Have you search something about this? I'm pretty sure this has been explained zillions of times before, for example, h

[Rails] Re: how to use Rails cron?

2009-11-07 Thread Newb Newb
hi all.. I m using cron for my application. already for my 1st task i use the schedule.rb again i want to use cron job again for my 2nd task. is it possible to use the same schedule.rb file? why i ask is whenever i modify any of my tasks settings it overwrites the schedule.rb file. so how can i s

[Rails] Running C processes, where do I put the C file?

2009-11-07 Thread Victor Martin
Hi there I make a call jsut like this: value = `./simulated_annealing` Which is a C Object file, but Rails tells me it cannot find that file. I put it in the same dir that the rest of the models files (since it's called by one of those models), but I guess it should be in any other place. What

[Rails] partials in rails

2009-11-07 Thread Aashish Kiran
I am new to rails. can anyone explain in detail about partials in rails. my rails version is 2.3.4. How to use them? -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on

[Rails] The iRequest Live! Rails + Qooxdoo

2009-11-07 Thread Gleb Mazovetskiy
Hi, everyone! We just released The iRequest Live! webapp. It is based on qooxdoo frontend, and Ruby on Rails backend. I have provided some qooxdoo + rails integration tips on the qooxdoo website. The iRequest Live! lets you create playlists from which people can request songs using any cellphone

[Rails] Re: Active Scaffold --- Help Urgent

2009-11-07 Thread Antony Nambikkai
Leonardo Mateo wrote: Ok Leanardo i will try this and get back to you . -- 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 grou

[Rails] Re: output values being converted?

2009-11-07 Thread Frederick Cheung
On Nov 7, 12:21 am, Matt Harrison wrote: > On Sat, Nov 07, 2009 at 12:06:07AM +, Matt Harrison wrote: > > It turns out that hash is a method defined by activerecord already. I > originally had problems naming my model Hash so I changed it to FileHash. I > didn't realise that hash was a meth

[Rails] [JOBS] 3x Sr Ruby on Rails developers (New Delhi)

2009-11-07 Thread Rails Delhi
We are looking for multiple talented Senior Web Developers with a history of commercial product & consumer-oriented web application design and high-end development and exposure to the full project life cycle. The successful candidate must have a excellent working knowledge of software design patte

[Rails] Re: Using will_paginate with arbitrary sql queries

2009-11-07 Thread Frederick Cheung
On Nov 7, 5:40 am, C K Kashyap wrote: > Hi All, > I have a situation where I have a task model, tag model and a link > table task_tags. > > In a particular view, I need to display a list of task that have a > certain tags - > For this, I'd need to run a query and get the results that would need

[Rails] Re: Active Scaffold --- Help Urgent

2009-11-07 Thread Leonardo Mateo
On Sat, Nov 7, 2009 at 6:57 AM, Antony Nambikkai wrote: > > Leonardo Mateo wrote: > > But Leonardo there is no Gem a Postgre Adapter > > I checked that already .. > > > Kindly help me ... > > also in database.yml file I change the the adapter name from postgresql > to postgre This wa

[Rails] Re: Active Scaffold --- Help Urgent

2009-11-07 Thread Antony Nambikkai
Leonardo Mateo wrote: But Leonardo there is no Gem a Postgre Adapter I checked that already .. Kindly help me ... also in database.yml file I change the the adapter name from postgresql to postgre This was suggested in a web page . Thanks in advance, Antony Prabhu N -- Po

[Rails] Re: Active Scaffold --- Help Urgent

2009-11-07 Thread Leonardo Mateo
On Sat, Nov 7, 2009 at 6:45 AM, Antony Nambikkai wrote: > > c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/connection_a > dapters/abstract/connection_specification.rb:76:in > `establish_connection': Pleas > e install the postgres adapter: `gem install > activerecord-postgres-

[Rails] Active Scaffold --- Help Urgent

2009-11-07 Thread Antony Nambikkai
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/connection_a dapters/abstract/connection_specification.rb:76:in `establish_connection': Pleas e install the postgres adapter: `gem install activerecord-postgres-adapter` (no such file to load -- active_record/connection_adapters/p

[Rails] Re: Where to save temp data?

2009-11-07 Thread Heinz Strunk
Hassan Schroeder wrote: > > Is there any chance your form data needs to persist across sessions, > (as in user leaves, comes back, resumes filling in unfinished form)? > > If not, you could save your variables in a hash in session. Otherwise > I would create a Form model and save it to the DB. >