[Rails] How to write console output into Text file in Ruby?

2011-08-06 Thread Amit Bobade
Hi, Could someone suggest me to how to write console output into Text file Ruby? I want to deal with the console output of the Ruby script. Please tell me how to do that? Please help. Thanks in advance. -- Thanks and Regards, Amit -- You received this message because you are subscribed to the

[Rails] Twitter related issue

2011-08-06 Thread Abhishek shukla
Hello, I am providing a facility where a user can tweet a content along with the url from my site(And it's working fine.), but Once after tweeting from my site no response I am getting from twitter. My Question is how do my system will know whether user has posted on twitter or not? It will be

[Rails] Re: How to write console output into Text file in Ruby?

2011-08-06 Thread 7stud --
f = File.open('text.txt', 'w') old_out = $stdout $stdout = f puts 'hello' puts 'world' f.close $stdout = old_out puts 'goodbye' --output:-- $ ruby ruby.rb goodbye $ cat text.txt hello world -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed

Re: [Rails] Re: How to write console output into Text file in Ruby?

2011-08-06 Thread Amit Bobade
Thanks for your prompt reply. This is really helpful. But if I want to write the following output to the text file then how should I achieve this? *Output:* Loaded suite simple Started . Finished in 0.203125 seconds. 1 tests, 1 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions, 0

[Rails] Newbie, are these associations right?

2011-08-06 Thread MC
First crack at an app. I have a friend with a private school that I'm trying to create a scheduling system for. So I have Coordinators creating school courses. Once the course is created the coordinator can assign multiple instructors, and then assign students to the course and instructor. So is

[Rails] Re: How to write console output into Text file in Ruby?

2011-08-06 Thread 7stud --
No one can answer that question. Your question is akin to asking: was multiplication or division used to get the number 6. -- 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,

Re: [Rails] Re: How to write console output into Text file in Ruby?

2011-08-06 Thread Amit Bobade
Ok. Thanks for your reply. Still I will be trying to get the solution. :) Thanks, -Amit On Sat, Aug 6, 2011 at 1:49 PM, 7stud -- li...@ruby-forum.com wrote: No one can answer that question. Your question is akin to asking: was multiplication or division used to get the number 6. -- Posted

[Rails] Re: bundle install fails because of git gem

2011-08-06 Thread Frederick Cheung
On Aug 6, 12:59 am, jjb123 jimmyblanch...@gmail.com wrote: Hey everyone, I'm having an incredibly difficult time getting bundle to work properly on my production server. Dumb question: is git installed (and is it a sufficiently recent version that it can work with https urls) ? Fred My

[Rails] Re: How to write console output into Text file in Ruby?

2011-08-06 Thread 7stud --
The point is: what did you do to get that output??? OKAY??! -- 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

[Rails] Can't destroy record

2011-08-06 Thread depassion
so when attempting to destroy a record i get this in the server log output: AREL (0.4ms) DELETE FROM items WHERE items.id = 39 Started GET /items/20 for 127.0.0.1 at 2011-08-06 10:59:27 +0200 AbstractController::ActionNotFound (The action 'show' could not be found for ItemsController): but a

[Rails] devise users/sign_out not working

2011-08-06 Thread Sayuj Othayoth
Hi comrades, I'm using devise sign_in and sign_up urls are workin but, when I try the url: http://localhost:3000/users/sign_out it generates routing error No route matches [GET] /users/sign_out How can I fix this? Thank you, Sayuj Othayoth -- You received this message because you are

Re: [Rails] Newbie, are these associations right?

2011-08-06 Thread Rafael Ubaldo
You may want to consider using a :through association. The coordinator may be better defined as a role type. Within a course people have a role: coordinator or student. The relationship between people and the course is through the role. Keeping the role object will indexing on the participants

[Rails] Re: Newbie, are these associations right?

2011-08-06 Thread Frederick Cheung
On Aug 6, 9:07 am, MC amev...@gmail.com wrote: First crack at an app. I have a friend with a private school that I'm trying to create a scheduling system for. So I have Coordinators creating school courses. Once the course is created the coordinator can assign multiple instructors, and then

Re: [Rails] Can't destroy record

2011-08-06 Thread Conrad Taylor
On Sat, Aug 6, 2011 at 2:21 AM, depassion kevin.b...@gmail.com wrote: so when attempting to destroy a record i get this in the server log output: AREL (0.4ms) DELETE FROM items WHERE items.id = 39 Started GET /items/20 for 127.0.0.1 at 2011-08-06 10:59:27 +0200

Re: [Rails] Re: Newbie, are these associations right?

2011-08-06 Thread Rafael Ubaldo
I think having the flexibility of having a student and or instructor assignable to different courses may come in handy. We may want to have records of past course participants. That's why a through association on a role may work out best. On Aug 6, 2011, at 2:42 AM, Frederick Cheung wrote:

[Rails] Re: Rails 3 possible bug in Routing

2011-08-06 Thread john paul
Hi sir, I have create one rails application ,am creating user form and using the session (logged on) and (logged out) , i dont know how its used am newipe in rails pls help regards, john -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed

Re: [Rails] Re: Rails 3 possible bug in Routing

2011-08-06 Thread Conrad Taylor
On Sat, Aug 6, 2011 at 2:52 AM, john paul li...@ruby-forum.com wrote: Hi sir, I have create one rails application ,am creating user form and using the session (logged on) and (logged out) , i dont know how its used am newipe in rails pls help regards, john John, I would recommend

[Rails] Activerecord joins models

2011-08-06 Thread Sayuj Othayoth
Hi, My models: #StatusMessage model *class StatusMessage ActiveRecord::Base belongs_to :users default_scope :order = created_at DESC end* #User Model *class User ActiveRecord::Base has_many :statue_messages end *In controller I want to join these two tables. When I use : *@status =

[Rails] No javascript runtime on Heroku

2011-08-06 Thread Karthikeyan
Hello all, I developed an app using Rails 3.1 and uploaded it to heroku. When I typed rake db:migrate , I got the following error: Could not find a JavaScript runtime. See https://github.com/sstephenson/execjs for a list of available runtimes. Does heroku support Rails 3.1? They seem to have no

[Rails] Re: Twitter related issue

2011-08-06 Thread Karthikeyan
You must ask twitter for this. Have you gone through their API? On Aug 6, 12:41 pm, Abhishek shukla bettera...@gmail.com wrote: Hello, I am providing a facility where a user can tweet a content along with the url from my site(And it's working fine.), but Once after tweeting from my site no

Re: [Rails] Re: Rails 3 possible bug in Routing

2011-08-06 Thread john paul
Thanks.. On Sat, Aug 6, 2011 at 3:45 PM, Conrad Taylor conra...@gmail.com wrote: On Sat, Aug 6, 2011 at 2:52 AM, john paul li...@ruby-forum.com wrote: Hi sir, I have create one rails application ,am creating user form and using the session (logged on) and (logged out) , i dont know

[Rails] Re: No javascript runtime on Heroku

2011-08-06 Thread Frederick Cheung
On Aug 6, 11:25 am, Karthikeyan mindas...@gmail.com wrote: Hello all, I developed an app using Rails 3.1 and uploaded it to heroku. When I typed rake db:migrate , I got the following error: Could not find a JavaScript runtime. Seehttps://github.com/sstephenson/execjs for a list of

[Rails] Re: Activerecord joins models

2011-08-06 Thread Frederick Cheung
On Aug 6, 11:21 am, Sayuj Othayoth sayujothay...@gmail.com wrote: Hi, My models: #StatusMessage model *class StatusMessage ActiveRecord::Base   belongs_to :users   default_scope :order = created_at DESC end* #User Model *class User ActiveRecord::Base   has_many :statue_messages

[Rails] Re: Gem and/or meta_where problem

2011-08-06 Thread Frederick Cheung
On Aug 3, 7:08 pm, Barney bsper...@gmail.com wrote: I've installed the gem meta_where (and it reported back: Succeeded) but when I use the example in a search method of a controller: Person.where(:some_field.matches = '%something%') there is an error that it doesn't know the method

[Rails] Re: upload zip file with paperclip

2011-08-06 Thread Frederick Cheung
On Aug 4, 7:32 pm, Aashish Kiran li...@ruby-forum.com wrote: ? p.preview.url = /system/previews/3/original/FTpreview.zip?1312375624 ? file=p.preview.url = /system/previews/3/original/FTpreview.zip?1312375624 url returns the url at which the file is available when accessed via the web

[Rails] rails 3 inflection

2011-08-06 Thread gatopardo
I am still confused by rails 3 new rules, and knowing so little about it,I want some help on a particular problem: inflection when creating models: what can I do in order to get rails generate model using words ending in 'a', so that the plural generated add an 's' If I edit

[Rails] Need a rails developer for a project

2011-08-06 Thread gojinj...@gmail.com
We are looking for a rails developer to join our startup. Some experience with SASS and MySQL is prefered but not a requirement. Our startup is working on a revolutionary platform for health and fitness and a passion for getting healthier and fit definitely helps. If you are looking to join a

[Rails] Re: rails 3 inflection

2011-08-06 Thread Frederick Cheung
On Aug 6, 12:16 pm, gatopardo gato.pa...@gmail.com wrote: I am still confused by rails 3 new rules, and knowing so little about it,I want some help on a particular problem: inflection when creating models:  what can I do in order to get rails generate model using words ending in 'a', so

[Rails] Re: devise users/sign_out not working

2011-08-06 Thread Nahuel Garbezza
Sayuj, Are you using JQuery? In that case, you can try rails g jquery:install. I had the same problem a few days ago. It's an issue related to DELETE actions. On 6 ago, 06:28, Sayuj Othayoth sayujothay...@gmail.com wrote: Hi comrades, I'm using devise sign_in and sign_up urls are workin

[Rails] Re: Need a rails developer for a project

2011-08-06 Thread ct9a
I'm in Melbourne, Victoria, Australia. Whereabouts are you? On Aug 6, 9:52 pm, gojinj...@gmail.com gojinj...@gmail.com wrote: We are looking for a rails developer to join our startup. Some experience with SASS and MySQL is prefered but not a requirement. Our startup is working on a

Re: [Rails] Re: Create action from a button?

2011-08-06 Thread beau trepp
:) It doesn't actually say that. I figured it was easier to change the text to represent an easier concept than the actual app. I did discover that i need to pass the arguments in this way though. Rather than specifying :action_id= id as a parameter, I needed to add it to the link. Eg

[Rails] Re: Windows 7 WAMP + Ruby on Rails Apache Errors

2011-08-06 Thread Luis Lavena
On Aug 5, 3:33 pm, Dave d...@coledesignstudios.com wrote: Hello all, I'm new to ruby on rails, been dealign with LAMP my entire carrier and have decided to take the dive and learn ruby. To start this off I decided I wanted to install ruby on my Window 7 PC at home with WAMP and learn from

[Rails] Tutorials

2011-08-06 Thread Rahul Rai
I have struggled a lot to run my first rails app on windows None of the tutorials explain in as simple as this one http://www.javapassion.com/handsonlabs/rails_basics/ could run hello world but the rest are not free how to get them ? -- You received this message because you are subscribed to

[Rails] Re: No javascript runtime on Heroku

2011-08-06 Thread Karthikeyan
Thanks a lot Federick On Aug 6, 3:57 pm, Frederick Cheung frederick.che...@gmail.com wrote: On Aug 6, 11:25 am, Karthikeyan mindas...@gmail.com wrote: Hello all, I developed an app using Rails 3.1 and uploaded it to heroku. When I typed rake db:migrate , I got the following error:

[Rails] Question about link_to

2011-08-06 Thread Pepe Sanchez
Hi all I am working on the first application from the book Head First Rails called tickets. What I do not understand is where the variable new_ticket_path gets populated in the view index.html.erb %= link_to 'New Ticket', new_ticket_path % Please advise -- Posted via

Re: [Rails] Question about link_to

2011-08-06 Thread Walter Lee Davis
On Aug 6, 2011, at 12:46 PM, Pepe Sanchez wrote: Hi all I am working on the first application from the book Head First Rails called tickets. What I do not understand is where the variable new_ticket_path gets populated in the view index.html.erb %= link_to 'New Ticket', new_ticket_path %

[Rails] Re: Question about link_to

2011-08-06 Thread Pepe Sanchez
Walter, So if I understand correctly new_ticket_path, edit_ticket_path, ticket are like constants that RoR assigns to them specific values. If I want to create a new link on my RoR Application to a new page called for example myblog, and add it to the index page, which will be the right

Re: [Rails] Re: Question about link_to

2011-08-06 Thread Walter Lee Davis
On Aug 6, 2011, at 1:22 PM, Pepe Sanchez wrote: Walter, So if I understand correctly new_ticket_path, edit_ticket_path, ticket are like constants that RoR assigns to them specific values. If I want to create a new link on my RoR Application to a new page called for example myblog, and add it

[Rails] Accessing datetime elements from hash passed to method

2011-08-06 Thread Jarek Plonski
I'm passing hash (called 'params') to a method. Some keys (one of them is called 'starts_at') in that hash have date as a value (taken from datetime_select helper). I want to access the date elements like date only or time only but I'm just out of ideas. def self.new_meeting(params) str =

[Rails] Photo album using RoR

2011-08-06 Thread SW Engineer
Are there tutorials that walk you through making a photo album using RoR? 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

Re: [Rails] Re: Activerecord joins models

2011-08-06 Thread tudor cornea
Try: has_many :StatueMessages instead of: * has_many :statue_messages* On Sat, Aug 6, 2011 at 1:58 PM, Frederick Cheung frederick.che...@gmail.com wrote: On Aug 6, 11:21 am, Sayuj Othayoth sayujothay...@gmail.com wrote: Hi, My models: #StatusMessage model *class StatusMessage

Re: [Rails] Re: Activerecord joins models

2011-08-06 Thread Sayuj Othayoth
Thank you I misspelled *has_many :status_messages* thank you very much On Sat, Aug 6, 2011 at 2:40 PM, tudor cornea tudor.cor...@gmail.com wrote: Try: has_many :StatueMessages instead of: * has_many :statue_messages* On Sat, Aug 6, 2011 at 1:58 PM, Frederick Cheung

[Rails] Re: Accessing datetime elements from hash passed to method

2011-08-06 Thread Frederick Cheung
On Aug 6, 7:20 pm, Jarek Plonski li...@ruby-forum.com wrote: I'm passing hash (called 'params') to a method. Some keys (one of them is called 'starts_at') in that hash have date as a value (taken from datetime_select helper). I want to access the date elements like date only or time only but

Re: [Rails] Re: rails 3 inflection

2011-08-06 Thread Colin Law
On 6 August 2011 13:48, Frederick Cheung frederick.che...@gmail.com wrote: On Aug 6, 12:16 pm, gatopardo gato.pa...@gmail.com wrote: I am still confused by rails 3 new rules, and knowing so little about it,I want some help on a particular problem: inflection when creating models:  what can

Re: [Rails] Tutorials

2011-08-06 Thread Colin Law
On 6 August 2011 15:59, Rahul Rai raikra...@gmail.com wrote: I have struggled a lot to run my first rails app on  windows If you have any choice at all then don't use windows for rails apps. Life will be much simpler if you can move to a Linux system such as Ubuntu. The learning curve time will

[Rails] Re: Accessing datetime elements from hash passed to method

2011-08-06 Thread Jarek Plonski
Time/date objects have methods like year, month, day etc. which return the individual components Well I know that but, can you, please, tell how to use those methods in my example? -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the

Re: [Rails] Re: Accessing datetime elements from hash passed to method

2011-08-06 Thread Colin Law
On 6 August 2011 20:50, Jarek Plonski li...@ruby-forum.com wrote: Time/date objects have methods like year, month, day etc. which return the individual components Well I know that but, can you, please, tell how to use those methods in my example? I don't know the format of you params string

[Rails] Re: Re: Accessing datetime elements from hash passed to method

2011-08-06 Thread Jarek Plonski
starts_at = Time.parse( params[:starts_at] ) puts starts_at.year Colin, this is exactly what I needed. Thank 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 group, send

[Rails] Re: Re: Accessing datetime elements from hash passed to method

2011-08-06 Thread 7stud --
Jarek Plonski wrote in post #1015315: starts_at = Time.parse( params[:starts_at] ) puts starts_at.year Colin, this is exactly what I needed. Thank you! :) Well, you lied. You didn't have a Date, you had a String. -- Posted via http://www.ruby-forum.com/. -- You received this message

[Rails] Re: Error: uninitialized constant MysqlCompat::MysqlRes

2011-08-06 Thread Lonny E.
If you have tried all the above and it still didn't work, try the instructions on THIS page: http://lightyearsoftware.com/2011/02/mysql-5-5-on-mac-os-x/comment-page-1/#comment-33204 It worked for me! (Don't forget to use the source command or restart your terminal session after modifying your

[Rails] Ruby-on-Rails developer for a social shopping website (freelance long term contract)

2011-08-06 Thread Jhonny Boy
1. THE STORY MISSION OF OUR COMPANY At Lookbook, we love fashion, shopping and trends. We believe that life should be lived fully and that all of us should strive to look our best, without spending too much time doing so. We are creating a platform to simplify your dressing-up process without

[Rails] Question About Forms

2011-08-06 Thread Bruno Meira
Hey everybody, I'm new on RoR and I was wondering with sb could help me. I have one page that interacts with a lot of controllers and actions, so I need to create many forms(one per action). Example: In this page I send message to user, make one vote in one post, remove one post. So I create one

[Rails] Re: Re: Accessing datetime elements from hash passed to method

2011-08-06 Thread Jarek Plonski
Well, you lied. You didn't have a Date, you had a String. I'm not saying that I know what I'm talking about :) I'm newbie but I didn't lie. What I said was: ...date as a value (taken from datetime_select helper) if it was a String then datetime_select returns a string, or Dates are Strings

[Rails] Re: Multiple database sources with Rails 2.2.2

2011-08-06 Thread Phil R.
I too am trying to do this. It seems like something that should be easily configurable. establish_connection :blah seems to work fine in the model, however causes problems in the migration used to create that model ActiveRecord::Base.establish_connection :blah The migration completes

[Rails] Re: Newbie, are these associations right?

2011-08-06 Thread MC
Frederick, I would want to be able to see what students are being taught be what instructor. And yes I would want to be able to know what the course the student is taking. So from my current setup are you saying I wouldn't get that? Or would I get that if I used a :through association? I'm sort

Re: [Rails] Re: Newbie, are these associations right?

2011-08-06 Thread Rafael Ubaldo
Mark, Here are some question I would raise in designing a domain model for an app like this: - Can students and or instructors participate and or coordinate more than one course simultaneously? - Do you want to retain record of past participation? The reason why I pointed out the role

[Rails] Re: bundle install fails because of git gem

2011-08-06 Thread jjb123
Yep, it's installed (I've used it on the server before). I'm not sure but I think this has something to do with RVM changing all of the application paths but I don't really know how to diagnose this. On Aug 6, 4:33 am, Frederick Cheung frederick.che...@gmail.com wrote: On Aug 6, 12:59 am, jjb123

[Rails] jquery UI with rails 3.1

2011-08-06 Thread Bharat Ruparel
What is the correct way to configure jQuery UI with Rails 3.1 application? Bharat -- 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

[Rails] How can I disable Rails 3.1's ActiveRecord Query Caching?

2011-08-06 Thread Phoenix Rising
Hey guys, As most of you know, Rails 3.1 introduces query caching for ActiveRecord. Great change all-in-all, but for those of us with IT department mandates for using MySQL (yeah, yeah, I know...), it's kind of a mixed bag. I need to disable query caching in a project I'm building based on 3.1.