Re: [Rails] Re: how to run the ruby script/server when the system starts

2011-10-11 Thread Colin Law
On 11 October 2011 06:56, hanish jadala emailtohoneyr...@gmail.com wrote: no no its not a order Mr.Luis Lavena seeking for help that's it. i have written a batch file for that command. i want to run that batch file automatically when windows start. looking for this process. i already my

Re: [Rails] Re: how to run the ruby script/server when the system starts

2011-10-11 Thread Peter Hicks
You're better asking a Windows guy than a Rails group. You can probably run the batch file as a service on Windows, but how to do that is beyond me. Peter On Oct 11, 2011 6:56 AM, hanish jadala emailtohoneyr...@gmail.com wrote: no no its not a order Mr.Luis Lavena seeking for help that's it. i

Re: [Rails] Help with images and videos

2011-10-11 Thread Peter Hicks
Have you considered storing the content outside the database and using filenames with a path to reference them? Peter On Oct 11, 2011 2:30 AM, Rodrigo Ruiz rodrigo.ru...@gmail.com wrote: Hi, I'd like to know what is the easiest and best way to save images and videos (both plural) into a model.

Re: [Rails] Re: Packaging for shipping product made out of RoR

2011-10-11 Thread Peter Hicks
Don't dismiss the contractual agreement - pushes the problem to your legal people. Another idea is providing the software on a virtual machine image. It has the benefit of being a packaging mechanism too. Peter On Oct 11, 2011 6:26 AM, mitch mlqmailbox-goo...@yahoo.com wrote: I believe the

[Rails] Apache Benchmark

2011-10-11 Thread Priya D.
Hi All, Am using ab(Apache Benchmark) for load test in my rails app. ab -n10 -c10 -p ~/post_data_ab.txt -T multipart/form-data; boundary=1234567 http://localhost:3000/albums I have used the above command for testing upload photos. But am getting the following error. [2011-10-11 11:38:38] ERROR

[Rails] how to do sum of two columns and store in another column in database

2011-10-11 Thread chand syed
Hai friends... My question is I have one table in that three columns a, b and c.. a=7 and b=10 given input now c value must be store as a+b means 7+10=17. Please can anybody tell me solution... Tahnk you. -- Posted via http://www.ruby-forum.com/. -- You received this message

[Rails] Re: gem update --system issue

2011-10-11 Thread subbarao
ok On Oct 6, 1:34 pm, iGbanam xigba...@gmail.com wrote: Try using `update_rubygems' Sent from an Asteroid in Space™ On 2011-10-04, at 12:26 AM, Benjamin Iandavid Rodriguez ian@gmail.com wrote: Are you trying to install rails 3.1?? On Oct 3, 2011 6:32 AM, subbarao

Re: [Rails] Re: Packaging for shipping product made out of RoR

2011-10-11 Thread Santosh c
Makes me wonder how the current vendors shipping their enterprise apps do it. We are a small shop, legal route will not work for us. Any references to how JRuby / War packaging works? Have done it with tomcat 7-8 yrs back, latest references/tutorials will help. thanks! On Tue, Oct 11, 2011 at

[Rails] Re: how to run the ruby script/server when the system starts

2011-10-11 Thread Luis Lavena
On Oct 11, 7:56 am, hanish jadala emailtohoneyr...@gmail.com wrote: no no its not a order Mr.Luis Lavena seeking for help that's it. i have written a batch file for that command. i want to run that batch file automatically when windows start. looking for this process. i already my started my

Re: [Rails] nested attributes question

2011-10-11 Thread Miquel Cubel
Hi, You can solved in the view or in the model, also depends where you place the default. Some ideas: 1. If default is in the product, in the product model add after_save, find the photo, get de id and save id in the product. 2. If default is in the photo, solved it in the view.

[Rails] Mechanize gem. What's the price?

2011-10-11 Thread comopasta Gr
Hi, I've been trying to fix a problem when making a https request using Net::HTTP No matter how I tried I was getting and EOF error. Then I tried with Mechanize gem and it worked like a charm. The code I use now for Mechanize is: agent = Mechanize.new agent.keep_alive = true page =

Re: [Rails] how to do sum of two columns and store in another column in database

2011-10-11 Thread Colin Law
On 11 October 2011 07:35, chand syed li...@ruby-forum.com wrote: Hai friends...  My question is I have one table in that three columns a, b and  c.. a=7 and b=10 given input now c value must be store as a+b means 7+10=17. Don't do it, there is no need as you can work it out whenever you

[Rails] Create Two objects at the same time

2011-10-11 Thread Nikhil Goyal
I have user model and referral model. Referral model has user_id as field. Now when a new user is created, I need to call referral#create as well and pass it the id of the newly generated user to user_id of referral model. How can I do that. -- You received this message because you are

Re: [Rails] Create Two objects at the same time

2011-10-11 Thread Owajigbanam Ogbuluijah
On 2011-10-11, at 11:23 AM, Nikhil Goyal wrote: I have user model and referral model. Referral model has user_id as field. Now when a new user is created, I need to call referral#create as well and pass it the id of the newly generated user to user_id of referral model. How can I do that.

[Rails] Ruby on Rails sqlite3 ranking

2011-10-11 Thread Pamela
I am making a browser-based game using ruby on rails and I am having trouble implementing a ranking system for my game. Each player has five skills: intelligence, creativity, strength, charisma and technological. I want the player to have a rank for each skill. The ranking I have in place right

[Rails] ROR Development Assignments at Pune

2011-10-11 Thread Priya
Hi, Am using ab(Apache Benchmark) for load test in my rails app. ab -n10 -c10 -p ~/post_data_ab.txt -T multipart/form-data; boundary=1234567 http://localhost:3000/albums ... I have used the above command for testing upload photos. But am getting error which I don't know how o handle. Can anyone

Re: [Rails] ROR Development Assignments at Pune

2011-10-11 Thread Norbert Melzer
Am 11.10.2011 12:52 schrieb Priya priya.positi...@gmail.com: Am using ab(Apache Benchmark) for load test in my rails app. ab -n10 -c10 -p ~/post_data_ab.txt -T multipart/form-data; boundary=1234567 http://localhost:3000/albums ... I have used the above command for testing upload photos. But

Re: [Rails] Create Two objects at the same time

2011-10-11 Thread Peter Vandenabeele
On Tue, Oct 11, 2011 at 12:23 PM, Nikhil Goyal goyal.nikhi...@gmail.comwrote: I have user model and referral model. Referral model has user_id as field. Now when a new user is created, I need to call referral#create as well and pass it the id of the newly generated user to user_id of

Re: [Rails] Re: Packaging for shipping product made out of RoR

2011-10-11 Thread Hassan Schroeder
On Mon, Oct 10, 2011 at 10:26 PM, mitch mlqmailbox-goo...@yahoo.com wrote: I believe the best method is to use Jruby and to produce a compiled WAR file Sorry, no -- WAR files are not compiled, and they're nearly always expanded at deployment anyway, so that's pointless. -- Hassan Schroeder

Re: [Rails] Re: Packaging for shipping product made out of RoR

2011-10-11 Thread mitch
Sketchy details on these Hobo threads. They are obviously having some success with Jruby. https://groups.google.com/forum/?hl=en-GB#!searchin/hobousers/war/hobousers/ChkP_ei4h_o/NzH0DPHjP6IJ

Re: [Rails] Re: Packaging for shipping product made out of RoR

2011-10-11 Thread Hassan Schroeder
On Tue, Oct 11, 2011 at 4:34 AM, mitch mlqmailbox-goo...@yahoo.com wrote: Sketchy details on these Hobo threads. They are obviously having some success with Jruby. success at what? Yes, you can certainly run JRuby/Rails from a WAR file. I'm maintaining one such application now. This does

Re: [Rails] Create Two objects at the same time

2011-10-11 Thread Everaldo Gomes
Hi! Last month I was reading Rails Antipatterns and if I understood well, your situation fits with one described in the book: The author says, in page 150: A presenter is simply a plain old Ruby class that orchestrates the creation of multiple models. I suggest you look for Active Presenter:

[Rails] Re: ROR Development Assignments at Pune

2011-10-11 Thread Priya D.
Hi Norbert, Please check the following link for detailed error. http://www.ruby-forum.com/topic/2762446#new Its working fine in browser.. Thanks -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk

Re: [Rails] Re: Packaging for shipping product made out of RoR

2011-10-11 Thread mitch
Ah...sorry about that. I haven't used JRuby myself but am planning to. I remember reading a long time ago that Thoughtworks have devised a method of code protection for their Mingle product, using JRuby. I don't know how its done though. http://en.wikipedia.org/wiki/Mingle -- You received

[Rails] Re: Help with images and videos

2011-10-11 Thread Rodrigo Ruiz
But how do I do that so that an admin can upload files at the admin interface? so that this admin doesn't need to know anything about programming or that setup. On Tuesday, October 11, 2011, Peter Hicks peter.hi...@gmail.com wrote: Have you considered storing the content outside the database and

[Rails] How to use carrierwave with active admin?

2011-10-11 Thread Rodrigo Ruiz
Hi, I'd like to upload images and videos with carrierwave at the active admin interface. Just to make it clear, the admin will change images and video at the website using active admin. if anyone knows how to do this please help me. Thank you, Rodrigo -- You received this message because you

Re: [Rails] Re: Packaging for shipping product made out of RoR

2011-10-11 Thread Hassan Schroeder
On Tue, Oct 11, 2011 at 5:32 AM, mitch mlqmailbox-goo...@yahoo.com wrote: I remember reading a long time ago that Thoughtworks have devised a method of code protection for their Mingle product, using JRuby. I don't know how its done though. There appears to be a free download -- you could

Re: [Rails] Help with images and videos

2011-10-11 Thread Peter Hicks
Add a field for the filename in the model object. populate this with the name of the file uploaded that you'd otherwise put in to the database. An alternative is to store the files in the database as a blob, but what if your database is then full of 20Mb rows? P On Oct 11, 2011 2:30 AM, Rodrigo

[Rails] Re: Help with images and videos

2011-10-11 Thread Rodrigo Ruiz
how do i upload that file to amazon s3, for example, using the active admin interface? and how do i get that file name? On Tuesday, October 11, 2011, Peter Hicks peter.hi...@gmail.com wrote: Add a field for the filename in the model object. populate this with the name of the file uploaded that

Re: [Rails] Re: Packaging for shipping product made out of RoR

2011-10-11 Thread mitch
Sorry no time. I'm snowed under with work. But there's gotta be a way, no? As I understand it, although the WAR file code can be viewed it can't be changed. If it references some kind of encrypted Java class which needs an external licence file, perhaps that would do it? The licence file

[Rails] Stream user's computer output to server?

2011-10-11 Thread Heinz Strunk
Hey, it might be a bit off topic but I hope I'm still allowed to post this. I'm currently looking for something (whatever language, script, ...) that allows users to click a button and stream the audio output of their computer to the server. Does anyone know anything that does this? Thanks --

[Rails] Polymorphic association with Active Admin

2011-10-11 Thread Rodrigo Ruiz
I have a belongs_to polymorphic association and I don't know how to create and edit my models of that relationship with active admin. If anyone can help me, please do. Thank you, Rodrigo -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To

Re: [Rails] Stream user's computer output to server?

2011-10-11 Thread iGbanam
Google scripts for file upload to get the user's information on your server. Streaming depends on how you handle the incoming data. Sent from an Asteroid in Space™ On 2011-10-11, at 3:41 PM, Heinz Strunk li...@ruby-forum.com wrote: Hey, it might be a bit off topic but I hope I'm still

Re: [Rails] Stream user's computer output to server?

2011-10-11 Thread Norbert Melzer
I don't think that anything about uploading a file would help the OP. As far as I understand he wants to record anything that sent to the sources and send this to the server. But this is not rails related... Besides that I think nearly any makers would be capable of that. My advise would be

[Rails] recursive finds

2011-10-11 Thread Craig White
I am trying to supplement and ultimately provide a patch for 'foreman' which is an adjunct to puppet. Essentially, there is a Hosts class which belongs_to Hostgroup and Hostgroup class has a column called 'ancestry' which is actually a Hostgroup (probably what is referred to as STI but I am

[Rails] Re: Stream users computer output to server?

2011-10-11 Thread Heinz Strunk
Yeah, exactly. I don't want a file upload. I want somebody to click a button and then the audio output of for example his music application streams to the server and then shoutcasted. What do you mean by any makers and advise not to? -- Posted via http://www.ruby-forum.com/. -- You received

Re: [Rails] Stream user's computer output to server?

2011-10-11 Thread Colin Law
On 11 October 2011 15:41, Heinz Strunk li...@ruby-forum.com wrote: Hey, it might be a bit off topic but I hope I'm still allowed to post this. I'm currently looking for something (whatever language, script, ...) that allows users to click a button and stream the audio output of their

Re: [Rails] Re: Stream users computer output to server?

2011-10-11 Thread Colin Law
On 11 October 2011 17:10, Heinz Strunk li...@ruby-forum.com wrote: Yeah, exactly. Since you have not quoted the message to which you are replying it is not clear to with what you are replying. In addition you have changed the subject line so have broken the thread, at least in some mail

[Rails] Dragonfly permissions problem on server

2011-10-11 Thread Walter Lee Davis
I am running in production on Ubuntu 10 with Passenger and Apache2. I just had to set my system/dragonfly folder to 777 in order to allow uploads to work, and that doesn't seem like a good idea or even necessary. What''s the trick to get this to work correctly (as in not world-writable folders

Re: [Rails] Dragonfly permissions problem on server

2011-10-11 Thread Craig White
On Oct 11, 2011, at 9:42 AM, Walter Lee Davis wrote: I am running in production on Ubuntu 10 with Passenger and Apache2. I just had to set my system/dragonfly folder to 777 in order to allow uploads to work, and that doesn't seem like a good idea or even necessary. What''s the trick to

Re: [Rails] Re: Packaging for shipping product made out of RoR

2011-10-11 Thread Hassan Schroeder
On Tue, Oct 11, 2011 at 7:15 AM, mitch mlqmailbox-goo...@yahoo.com wrote: But there's gotta be a way, no?  As I understand it, although the WAR file code can be viewed it can't be changed. Sorry, that's not true. A WAR file is just a packaged (equivalent to tar) directory structure that's

[Rails] Expert advice on realtime Instant messaging in rails 3 ?

2011-10-11 Thread rubybox
Are there any decent example apps for an ruby on rails 3 instant Messenger app based on any of the publish-subscribe messaging systems out there? ( Cram, Faye, Juggernaut ) I want to build a private 1-1 chat system based on these techniques but having a hard time finding anything decent

Re: [Rails] Dragonfly permissions problem on server

2011-10-11 Thread Walter Lee Davis
On Oct 11, 2011, at 12:54 PM, Craig White wrote: On Oct 11, 2011, at 9:42 AM, Walter Lee Davis wrote: I am running in production on Ubuntu 10 with Passenger and Apache2. I just had to set my system/dragonfly folder to 777 in order to allow uploads to work, and that doesn't seem like a

[Rails] missing template caused by locale ?

2011-10-11 Thread Erwin
I am using a default_locale in my app config.i18n.default_locale = :fr When setting up the administration part, I don't need to have a foreign locale, default :en would be fine is this error message caused by non setting the default.locale to :en ? as it's stated ::locale=[:fr, :fr]} by

[Rails] Want to implement APIs in Rails.

2011-10-11 Thread UA
Hi, I want to write APIs for my rails 3.1 application but have never written an API ever. I am supposed to write REST and SOAP APIs. Is there a formal book or e-book or screencasts or tutorials which teaches about APIs in Rails and best practices? -- You received this message because you are

[Rails] Re: Create Two objects at the same time

2011-10-11 Thread Nikhil Goyal
I had setup the associations, one to one, because that was the requirement User Model has_one :referral Referral Model belongs_to :user and I also setup a user_id column in Referral model. But what I did not know was about the magic call BUILD Now I guess, all I have to do is @user =

Re: [Rails] Dragonfly permissions problem on server

2011-10-11 Thread Craig White
On Oct 11, 2011, at 10:12 AM, Walter Lee Davis wrote: On Oct 11, 2011, at 12:54 PM, Craig White wrote: On Oct 11, 2011, at 9:42 AM, Walter Lee Davis wrote: I am running in production on Ubuntu 10 with Passenger and Apache2. I just had to set my system/dragonfly folder to 777 in

Re: [Rails] Re: Create Two objects at the same time

2011-10-11 Thread Peter Vandenabeele
On Tue, Oct 11, 2011 at 7:38 PM, Nikhil Goyal goyal.nikhi...@gmail.comwrote: I had setup the associations, one to one, because that was the requirement User Model has_one :referral Referral Model belongs_to :user and I also setup a user_id column in Referral model. But what I did not

Re: [Rails] Re: Stream users computer output to server?

2011-10-11 Thread Norbert Melzer
I meant any malware would be capable of that. And said this correctly and not got it broken by T9 it should be clearly visible why I recommended not to do this! -- send by Samsung Galaxy Tab with Overcome Mod Am 11.10.2011 18:10 schrieb Heinz Strunk li...@ruby-forum.com: Yeah, exactly. I don't

[Rails] re rendering into a form/table

2011-10-11 Thread Jedrin
I have this inside of a template where I have a remote form with the form fields inside of a table: div id='ingredients_div' %= render :partial = 'ingredients', :locals = {:attr = attr} % /div my _ingredients.html.erb template is like so: -

Re: [Rails] Ruby on Rails sqlite3 ranking

2011-10-11 Thread Kalastiuz
what if: ranked_players = Array.new Player.all(:order = 'intelligence').each_with_index do |player| ranked_players #{index + 1}. #{player[:name]} with #{player[:intelligence]} intelligence end #now you have ranked players list ranked_players.each do |player| puts player end On Mon, Oct 10,

Re: [Rails] re rendering into a form/table

2011-10-11 Thread Colin Law
On 11 October 2011 20:38, Jedrin jrubia...@gmail.com wrote: I have this inside of a template where I have a remote form with the form fields inside of a table:  div id='ingredients_div'   %= render :partial = 'ingredients',      :locals = {:attr = attr} %  /div my _ingredients.html.erb

[Rails] Re: Stream user's computer output to server?

2011-10-11 Thread Heinz Strunk
Colin Law wrote in post #1026101: On 11 October 2011 15:41, Heinz Strunk li...@ruby-forum.com wrote: Do you mean click a button on a web page? If so then I hope that it is not possible. It should not be possible to do such things from a browser. If you are not talking about in the browser

[Rails] Re: Re: Stream users computer output to server?

2011-10-11 Thread Heinz Strunk
Norbert Melzer wrote in post #1026121: I meant any malware would be capable of that. And said this correctly and not got it broken by T9 it should be clearly visible why I recommended not to do this! -- send by Samsung Galaxy Tab with Overcome Mod Am 11.10.2011 18:10 schrieb Heinz Strunk

Re: [Rails] Re: Stream user's computer output to server?

2011-10-11 Thread Colin Law
On 11 October 2011 21:05, Heinz Strunk li...@ruby-forum.com wrote: Colin Law wrote in post #1026101: On 11 October 2011 15:41, Heinz Strunk li...@ruby-forum.com wrote: Do you mean click a button on a web page?  If so then I hope that it is not possible.  It should not be possible to do such

[Rails] Re: missing template caused by locale ?

2011-10-11 Thread Erwin
[SOLVED] nothing related to locale ... existing template was admin/ categories/color.js.erb should be admin/categories/colors.js.erb ! On 11 oct, 19:33, Erwin yves_duf...@mac.com wrote: I am using a default_locale in my app config.i18n.default_locale = :fr When setting up the

[Rails] Re: Re: Create Two objects at the same time

2011-10-11 Thread Robert Walker
Peter Vandenabeele wrote in post #1026116: * actually, I believe what you propose above will not work, it would probably be @user.build_referral # untested Actually, your believe isn't accurate. You should have tested. :) See collection.build and collection.create explained here:

[Rails] Re: Re: Create Two objects at the same time

2011-10-11 Thread Robert Walker
Robert Walker wrote in post #1026165: Peter Vandenabeele wrote in post #1026116: * actually, I believe what you propose above will not work, it would probably be @user.build_referral # untested Actually, your believe isn't accurate. You should have tested. :) See collection.build and

[Rails] Re: formtastic / activeadmin

2011-10-11 Thread Noel Hwande
Remco Swoany wrote in post #1025137: tried this: f.inputs Appartment Details do f.input :assets do |asset_fields| asset_fields.file_field.input :asset, :as = :file end end there is no upload button available. What i am doing wrong? Grtz..Swoany Hi, were you

Re: [Rails] Re: Packaging for shipping product made out of RoR

2011-10-11 Thread Santosh c
Sorry, that's not true. A WAR file is just a packaged (equivalent to tar) directory structure that's usually un-WAR'd on deployment. And you can do anything you want with the contents at that point. Could you give me a reference to building and deploying a WAR for a ruby web app? thanks.

Re: [Rails] Re: Recommended SOAP library

2011-10-11 Thread Leonardo Mateo
On Sat, Oct 8, 2011 at 11:08 PM, Keith Pitty ke...@keithpitty.com wrote: Another +1 from me for Savon. Keith On Oct 9, 5:59 am, Ylan y...@alxglobal.com wrote: +1 on Savon. Worked pretty painlessly for me. Looks like Savon is the chosen one then. Thanks a lot, guys, I'll be using this in

Re: [Rails] Ruby on Rails sqlite3 ranking

2011-10-11 Thread Roy Situmorang
Correction: ranked_players = Array.new Player.all(:order = 'intelligence').each_with_index do |player, index| ranked_players #{index + 1}. #{player[:name]} with #{player[:intelligence]} intelligence end #now you have ranked players list ranked_players.each do |player| puts player end On

Re: [Rails] Want to implement APIs in Rails.

2011-10-11 Thread Roy Situmorang
I suggest you to read Rails 3 in Action book written by Ryan Bigg and Yehuda Katz. On Wed, Oct 12, 2011 at 12:37 AM, UA ritvi...@gmail.com wrote: Hi, I want to write APIs for my rails 3.1 application but have never written an API ever. I am supposed to write REST and SOAP APIs. Is there a

[Rails] scopes related question

2011-10-11 Thread slava
Hello, Have a question related scope definition. I need to define a scope based on related model attribute values like this. class Product ActiveRecord::Base belongs_to :currency scope :with_currency, lambda { |currency| unless currency.to_s.upcase == 'ALL' # here I need to define a

Re: [Rails] Re: Packaging for shipping product made out of RoR

2011-10-11 Thread Hassan Schroeder
On Tue, Oct 11, 2011 at 6:44 PM, Santosh c santoshc...@gmail.com wrote: Could you give me a reference to building and deploying a WAR for a ruby web app?  thanks. Are you familiar with the Servlet Spec? If not, I'd strongly recommend reading it to understand how a Java web app (and hence a WAR