[Rails] Re: what's the easiest way for novice to install RoR

2009-04-29 Thread damianham
I forgot something also type in the terminal window after installing the rails gem sudo gem install mysql On Apr 28, 11:59 am, Sumon wrote: > hi, > > i am fairly novice in RoR. Even i don't have clear idea of RoR. but i > am highly interested to learn RoR. i have some experience in php > (mos

[Rails] Re: what's the easiest way for novice to install RoR

2009-04-29 Thread damianham
download and install ubuntu from ubuntu.org open Applications->Acccessories->Terminal and type sudo apt-get install mysql sudo apt-get install ruby sudo apt-get install rubygems sudo gem install rails cd /var/www sudo chown $USER . rails mywebsite cd mywebsite script/server click on the firefox

[Rails] IS rails_ramf is compatible with rails 2.3.2 as i m ...

2009-04-29 Thread Hamid Raza
E:\D Drive\Ruby Projects\test_xml>ruby script/server webrick => Booting WEBrick => Rails 2.3.2 application starting on http://0.0.0.0:3000 c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:440:in `load_missing_constant ': uninitialized constant RAMF::OperationPr

[Rails] Re: Controller Instance Variables

2009-04-29 Thread Robert Walker
Doug Jolley wrote: >> because that will set the instance variable in the wrong object. you >> could use controller.instance_variable_set but that's just disgusting. > > Well now, hold on there a minute, Fred. :) I kind of like it. In > fact, it's exactly what I asked for. I don't find it all t

[Rails] Re: Controller Instance Variables

2009-04-29 Thread Robert Walker
Morgan Christiansson wrote: > Hi djolley. You can also use class variables or global variables: > > test.rb: > > $b='global value' > class MyTest > @@a='class value' > def class_val > @@a > end > def global_val > $b > end > end > BAD RUBY!! No global vars! Don't even go there.

[Rails] Re: Errno::ECONNREFUSED (Connection refused - connect(2)) Act

2009-04-29 Thread Salil Gaikwad
It's done. i change two things 1] in enviorment.rb ActionMailer::Base.delivery_method = :smtp to ActionMailer::Base.delivery_method = :sendmail and 2] in config\environments\production.rb uncomment following line config.action_mailer.raise_delivery_errors = false -- Posted via http://www.

[Rails] Plese have a look on this error and tell me y it comes

2009-04-29 Thread Hamid Raza
Drive\Ruby Projects\ramf>ruby script/generate model category by/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:440:in `load_missing_constant initialized constant RAMF::OperationProcessorsManager (NameError) from c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.2/l

[Rails] [ANN] rspec-rails 1.2.5 Released

2009-04-29 Thread David Chelimsky
rspec-rails version 1.2.5 has been released! * * * * * Behaviour Driven Development for Ruby on Rails. Changes: ### Version 1.2.5 / 2009-04-29

[Rails] [ANN] rspec 1.2.5 Released

2009-04-29 Thread David Chelimsky
rspec version 1.2.5 has been released! * * * * Behaviour Driven Development for Ruby. Changes: ### Version 1.2.5 / 2009-04-29 * enhancements * name argument to mock/stub is now optional (c

[Rails] Re: find_by...

2009-04-29 Thread Neo
you can use to_param in the model witch is a screencast in www.railscasts.com 2009/4/30 Frederick Cheung > > > > On Apr 29, 10:28 pm, slava wrote: > > Hello, > > I am trying to construct a lookup based on params submited. > > possible urls.. > > /gadgets?product_id=1 > > /gadgets?product_id=1&pr

[Rails] Error : (undefined method `write')

2009-04-29 Thread Roger Hansen
Complete line from error inside SciTE : test.rb:12: undefined method `write' for # (NoMethodError) Error results from this line : google_data.to_xml.write($stdout, 1) ... trying to use this Scrubyt sample script on Wi

[Rails] Re: Flash notices are not accessible on next request

2009-04-29 Thread Tom Hoen
7stud -- wrote: > Is there a second redirect in your code somewhere? That is a good thought. I was thinking along the same lines, so checked the console after issuing a request that should end with a displayed flash message and saw that there was only a single redirect. I also tried adding "k

[Rails] Re: Polymorphic Associations... confusing. Do I need them?

2009-04-29 Thread Chris Hanks
Yeah, I was able to figure it out and everything's working great, just like I wanted. Thanks again! Daniel Bush wrote: > Not sure how experienced you are with polymorphic assocs. I omitted > some > details chief of which is that you need two fields in your sections > table: > sectionable_id

[Rails] Re: Automatically delete oldest post of a specified tag

2009-04-29 Thread Franco Catena
You really need to delete the post? With :limit => 20 in your find is not enought?. If the answer is a double yes, then you should use an ActiveRecord callback (perhaps after_save http://api.rubyonrails.org/classes/ActiveRecord/Callbacks.html#M002084) Regards. Franco Catena. On Apr 29, 7:12 pm,

[Rails] Re: how to combine SQL queries in self.up

2009-04-29 Thread s.ross
ActiveRecord is available to you. Inside the self.up, you can do: AnyArbitraryModel.connection.execute(all_of_your_sql) Any model in your app will do, as you are bypassing your model's business rules and going directly to the connection. The return is a Mysql::Result, which you can look up h

[Rails] Re: Polymorphic Associations... confusing. Do I need them?

2009-04-29 Thread Daniel Bush
Not sure how experienced you are with polymorphic assocs. I omitted some details chief of which is that you need two fields in your sections table: sectionable_id and sectionable_type. There's a shortcut for doing this in a rails migration t.references :sectionable , :polymorphic => true or som

[Rails] Re: BUG - content_type assignment case sensitive

2009-04-29 Thread Rick
Hello Frederick, Here's how I've tested Ruby 1.8.7 (2008-08-11 patchlevel 72) [powerpc-darwin9.6.0] Rails 2.3.2 Webrick Thin 1.0.0 Mongrel 1.1.5 rmagick 2.9.1 ImageMagick 6.5.1 attachment_fu - current version paperclip - current version and Ruby 1.9.2dev (2009-04-25 trunk 23281) [powerpc-darwi

[Rails] Re: Flash notices are not accessible on next request

2009-04-29 Thread 7stud --
Tom Hoen wrote: > Any thoughts would be greatly appreciated. Ok, total beginner here. As far as I know, the flash is only available to the next request after the current request, and then it's automatically deleted. So if your flash is empty, there must have been two requests since you set t

[Rails] Re: find_by...

2009-04-29 Thread Frederick Cheung
On Apr 29, 10:28 pm, slava wrote: > Hello, > I am trying to construct a lookup based on params submited. > possible urls.. > /gadgets?product_id=1 > /gadgets?product_id=1&product_group_id=2 > /gadgets?product_location_id=5 > /gadgets?product_id=1&product_location=5 > ... > > How do I write a un

[Rails] Re: Complete newbie questions

2009-04-29 Thread Frederick Cheung
On Apr 29, 9:04 pm, dlittle wrote: > > The main system in question is a visitor check-in system where a host > (the person they're visiting) has an admin enter visitor info.  Once > entered, it shows up at the guard station where they're checked in and > then proceed to pick up a visitor badge.

[Rails] Re: We're sorry, but something went wrong.

2009-04-29 Thread 7stud --
Jeremy McAnally wrote: > It should. Sorry, I'm not sure what that is referring to. > How are you running your app? If you run it with > script/server, unless you're forcing production mode, you should get a > nice error page with a stack trace, error information, session dump, > etc. > > --

[Rails] Re: Testing an external script

2009-04-29 Thread James Byrne
Phlip wrote: > By "testing" you just mean "running", right? > I ended up with this: task = "ruby #...@forex_xfr_script} " + "'-f #...@forex_outfile_type}' " + "'-o #...@forex_outfile_name}' " + "-t" stdout = %x(#{task}) -- Posted via http:

[Rails] Automatically delete oldest post of a specified tag

2009-04-29 Thread Victor Vlist
I have a form that allows a user to create a post with a title, body, image and a tag. All fields are required using validates_presence_of and has_attached_file in the model. Since every post has a tag, there is a page for each tag that has all the posts with that tag paginated on it. When this ta

[Rails] tiny_mce and jquery + jrails

2009-04-29 Thread Sam Kong
Hi, I've been using tiny_mce_plus. Recently I changed prototype to jquery and jrails. It caused problems to tiny_mce_plus. So I replaced the prototype.js part in tiny_mce_plus with jquery and jrails. But according to log, the tiny_mce still uses prototype.js even if I restarted rails app. I grep

[Rails] Re: BUG - content_type assignment case sensitive

2009-04-29 Thread Frederick Cheung
On Apr 29, 8:52 pm, Rick wrote: \> NOTE: the content_type associated with .jpg is image/jpeg > NOTE: the content_type associated with .JPG is text/plain > > This difference causes Firefox to identify all .JPG files as "JPEG > Picture" rather than "image/jpeg...", resulting in different behavior

[Rails] Storing & retrieving a serialized hash in the DB is not working.

2009-04-29 Thread RNHurt
Hey all, I am trying to find a way to store an hash of variable size (could be 3 pairs, could by 8 pairs) in a text field in the database. I have the following [simplified] setup: # model serialize :content # controller [all the normal create, edit, etc. stuf] # view <% form_for @grading

[Rails] overriding associations problem

2009-04-29 Thread lakerhy
class User < ActiveRecord::Base belongs_to :creator, :class_name => 'Admin', :foreign_key => :creator_id end class CreateUsers < ActiveRecord::Migration def self.up create_table :users do |t| t.column :name, :string t.column :creator_id, :string t.timestamps end en

[Rails] Re: problem with nil.user

2009-04-29 Thread E. Litwin
When are you saving the user_id to the session? You need to force a redirect to a login page if there is no session [:user_id] and you should also handle the fact that session[:user_id] may be nil in your is_logged_in? method. On Apr 29, 1:15 pm, Stephen Fagan wrote: > Hi all, I've put new code

[Rails] [JOBS] Software Developer opening in Washington, DC

2009-04-29 Thread Jobs
Hello! We are currently looking for a Software Developer of the geeky persuasion (so we figured it would be good to post here!) for a contract opening. The client is located in Washington, DC (we can't do remote work, sorry!). We are looking for candidates that will excel in a challenging, high v

[Rails] Complete newbie questions

2009-04-29 Thread dlittle
I'm just learning Rails and am starting out by reading LOTS of books and websites and converting a simple system (4 tables, 32 fields including keys and timestams, 3 web screens and 4 "admin" screens written in 4th Dimension) but a few questions still remain with how someone with Rails experience

[Rails] find_by...

2009-04-29 Thread slava
Hello, I am trying to construct a lookup based on params submited. possible urls.. /gadgets?product_id=1 /gadgets?product_id=1&product_group_id=2 /gadgets?product_location_id=5 /gadgets?product_id=1&product_location=5 ... How do I write a universal lookup method ? Gadget.find_by_product_id Gadge

[Rails] Re: problem with nil.user

2009-04-29 Thread Jeff Lewis
Just to followup if you're interested, the error msg from the op was due to the fact that the call to session[:user_id] returned nil, and thus calling find(nil) resulted in that error being raised. If you wanted to avoid such an error and just have the find call return nil if not found, one

[Rails] Re: Testing an external script

2009-04-29 Thread Phlip
By "testing" you just mean "running", right? James Byrne wrote: > How does one pass a command line, including arguments, from a Ruby > script to the shell. Specifically > > some_method("#...@script} -o #...@outfile} -f #...@format}") > > I have tried Kernel.` Kernel.system, %x but have not h

[Rails] Re: problem with nil.user

2009-04-29 Thread Stephen Fagan
Rick Lloyd wrote: > Try > > def is_logged_in? > @logged_in_user = User.find(session[:user]) if session[:user] > end > > On Apr 29, 10:15�am, Stephen Fagan Thanks Rick. It worked a treat and also opened up a couple of gaping holes aswell (which I've managed to rectify!) Cheers Stephen.

[Rails] keeping uploads through form errors with attachment_fu?

2009-04-29 Thread Xavi Caballe
I'm using attachment_fu. If the user submits a form with a file attachment and validation fails for some reason not related to the attachment, he is currently forced to choose and upload the file again. Is there a way to avoid this? The old FileColumn ( http://www.kanthak.net/opensource/file_colu

[Rails] Re: problem with nil.user

2009-04-29 Thread Rick
Try def is_logged_in? @logged_in_user = User.find(session[:user]) if session[:user] end On Apr 29, 10:15 am, Stephen Fagan wrote: > Hi all, I've put new code into my app so that an administrator will have > extra privileges (administer users, edit pages). The error is: > > 'Couldn't find User

[Rails] problem with nil.user

2009-04-29 Thread Stephen Fagan
Hi all, I've put new code into my app so that an administrator will have extra privileges (administer users, edit pages). The error is: 'Couldn't find User without an ID' So the app is looking for a logged in user when the homepage is accessed. Heres my code: site/index view: <% if is_logged_

[Rails] Re: We're sorry, but something went wrong.

2009-04-29 Thread Jeremy McAnally
It should. How are you running your app? If you run it with script/server, unless you're forcing production mode, you should get a nice error page with a stack trace, error information, session dump, etc. --Jeremy On Fri, Apr 24, 2009 at 2:17 AM, 7stud -- wrote: > > I'm just wondering why rai

[Rails] Re: dbd-odbc gem not found

2009-04-29 Thread Dave Nolan
It's not the gem that's missing. It's the Ruby ODBC bindings which you need from here: http://www.ch-werner.de/rubyodbc/. Once the correct Ruby bindings are installed, you can require 'odbc' with no dependencies. HTH, Dave -- Posted via http://www.ruby-forum.com/. --~--~-~--~~---

[Rails] BUG - content_type assignment case sensitive

2009-04-29 Thread Rick
I sent my original post to this group under the title "Is mime content type case sensitive". It's made it to page 3 and I think I've found a bug so I'm re-posting. I have a very simple example that uses one of the attachment plugins to upload jpeg image files, creating thumbs on the way to stori

[Rails] Flash notices are not accessible on next request

2009-04-29 Thread Tom Hoen
For some reason, which I cannot detect, no flash notices that I set prior to redirects are available after the redirect. This standard "forgot password" action as an example: def forgot if request.post? user = User.find_by_email(params[:user][:email]) if user user.create

[Rails] Re: Is mime content type case sensitive?

2009-04-29 Thread Rick
I just looked at the headers associated with my problem and here's what I saw: -- http://localhost:3000/mugshots//0001/DSCN0925_thumb.jpg?1241031678 GET /mugshots//0001/DSCN0925_thumb.jpg?1241031678 HTTP/1.1 Host: localhost:3000 Use

[Rails] Re: We're sorry, but something went wrong.

2009-04-29 Thread 7stud --
7stud -- wrote: > 7stud -- wrote: >> >> Is the error saying Product isn't hashable? >> > > I think that had to do with an old version of the cart implemented with > an array that was still stored in sessions. I cleared my sessions with: > > rake db:sessions:clear > > and that got rid of the

[Rails] Re: We're sorry, but something went wrong.

2009-04-29 Thread 7stud --
7stud -- wrote: > > Is the error saying Product isn't hashable? > I think that had to do with an old version of the cart implemented with an array that was still stored in sessions. I cleared my sessions with: rake db:sessions:clear and that got rid of the error. -- Posted via http://www.r

[Rails] Re: Rails generates incomplete schema

2009-04-29 Thread blgroup
Apparently config.active_record.schema_format = :sql in environment.rb was the trick I was looking for. Not very obvious. Not obvious that your test DB schema will be different than your dev/prod schema should you start putting weird stuff in your migrations. =Blair. On Apr 28, 1:32 pm, blgrou

[Rails] Re: We're sorry, but something went wrong.

2009-04-29 Thread 7stud --
Frederick Cheung wrote: >> � attr_reader :items >> > A hash with a default value that is a proc has (you guessed it) a proc > embedded in it. There are a few places in rails where if things go > badly wrong at a time rails didn't expect it you just get a 'sorry > it's screwed' error rather than th

[Rails] Routes difference with Ruby 1.8.6 and 1.8.7

2009-04-29 Thread Bosko Ivanisevic
Recently I've found Enki, blog engine written in Rails. It is very simple and I though I could use it, but I've faced one problem that prevented it. Namely: rake spec ran from Ruby 1.8.6 and 1.8.7 gives different results. On 1.8.6 all tests pass but on 1.8.7 four (similar) errors occur. In route

[Rails] Re: Reg Expression Help Please?

2009-04-29 Thread Gavin
Actually... Just found this => http://coderay.rubychan.de/ looks perfect for my needs Thanks for your suggestions guys --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this gr

[Rails] Re: Reg Expression Help Please?

2009-04-29 Thread Gavin
I had planned on formatting the code tags with CSS as you suggested Rob but I also need to wrap specific words in spans to specify their colour --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk"

[Rails] Re: Reg Expression Help Please?

2009-04-29 Thread Gavin
I was planning on editing the text blob before it's saved to the database. So a blob like: "This is a big blob of text This is the code part This is another line" would be converted to: "This is a big blob of text This is the code part This is another line" And then called back as <%= @article.

[Rails] Re: Reg Expression Help Please?

2009-04-29 Thread James Byrne
> > I'd like to edit certain properties of some of the HTML tags, for > example, converting all spaces inside tags to   > Take a look at CGI#escape and CGI#escapeElement -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this messa

[Rails] Re: Reg Expression Help Please?

2009-04-29 Thread Rob Biedenharn
Use a CSS rule to style it? code { white-space: pre; } or: code { white-space: nowrap; } You're just asking for a headache if you try to match paired and possibly nested HTML tags with a Regexp. (Not that it can't be done, but it gets ugly fast and you need a very capable regular expressio

[Rails] Testing an external script

2009-04-29 Thread James Byrne
How does one pass a command line, including arguments, from a Ruby script to the shell. Specifically some_method("#...@script} -o #...@outfile} -f #...@format}") I have tried Kernel.` Kernel.system, %x but have not hit on a correct syntax yet. -- Posted via http://www.ruby-forum.com/. --~--

[Rails] Re: Reg Expression Help Please?

2009-04-29 Thread alberto
>The body is a text column in which people can add text and HTML. If this is the use case, then you want to protect what the user enters. Using RedCloth or other markup library might do a better job of what you are trying to achieve. --~--~-~--~~~---~--~~ You rece

[Rails] Re: Is mime content type case sensitive?

2009-04-29 Thread Rick
Yes I agree, my problem is with file extensions and is platform specific but I'ld like to understand it so I can get a fix. So in the time since I wrote the original post, I've done some more testing. I've run now with the following combinations: Browsers: Firefox (2.0.0.9, 3.0.8, 3.0.10), Safa

[Rails] Re: Reg Expression Help Please?

2009-04-29 Thread Tim
You don't want to fall into the rat hole of parsing HTML with regexes. You need a parsing library like hpricot or similar. http://wiki.github.com/why/hpricot good luck! Tim On Apr 29, 11:09 am, Gavin wrote: > Hi all > > I'm having a bit of trouble trying to acheive something, maybe someone >

[Rails] Reg Expression Help Please?

2009-04-29 Thread Gavin
Hi all I'm having a bit of trouble trying to acheive something, maybe someone can help? I have a model Article, which has an attribute 'body' The body is a text column in which people can add text and HTML. I'd like to edit certain properties of some of the HTML tags, for example, converting a

[Rails] Re: [ANN] Lone Star Twitter/Ruby Conference 2009

2009-04-29 Thread Rick DeNatale
On Wed, Apr 29, 2009 at 11:41 AM, wrote: > Half of the speakers complained that 140 characters was > not enough for an interesting talk, and that they needed at > least 180. > > The other half of the speakers thought the conference > was an elaborate scheme by Ashton Kutcher to publicly > punk

[Rails] Re: implicit function return values ?

2009-04-29 Thread Frederick Cheung
On Apr 29, 5:00 pm, cban1 wrote: > I'm sure this is a trivial question, but I'm a java/C programmer and > am not used to implicit returns. > > If I have a function: > > def check_range ( num ) >   rng = 0..10 > >   rng.include?( num ) > end > > ... does check_range evaluate to true or false dep

[Rails] Re: Is mime content type case sensitive?

2009-04-29 Thread Anupom
> All works as advertised as long as the filename's type is lowercase. > i.e.: >file.jpg === good >file.JPG === bad i think you are talking about file extensions, not mime type. mime content-type for jpeg files is image/jpeg (type is image and subtype is jpeg not jpg) but they can have .jp

[Rails] Ruby on Rails Developer opening

2009-04-29 Thread Dean
We have a client located in Rolling Meadows that has 2 permanent openings for Ruby on Rails/Java Developers. One is mid level and the other is a Senior level Ruby on Rails developer. Salaries open at this time. Good benefits. Required Skills: : Strong proficiency with the following programming

[Rails] [new to ruby] implicit function return values ?

2009-04-29 Thread cban1
I'm sure this is a trivial question, but I'm a java/C programmer and am not used to implicit returns. If I have a function: def check_range ( num ) rng = 0..10 rng.include?( num ) end ... does check_range evaluate to true or false depending on whether 'num' is in the range (based on the la

[Rails] Re: Is mime content type case sensitive?

2009-04-29 Thread Anupom
AFAIK according to W3C spec, mime Content-Type header (type/subtype) is not case sensitive. That is, image/jpeg, Image/Jpeg and image/JPEG - all mean the same. I agree with Robert, I guess the issue you are having is platform and implementation specific. On Wed, Apr 29, 2009 at 8:03 PM, Robert Wa

[Rails] Re: Truncate function and html tags

2009-04-29 Thread Emanuele Tozzato
https://rails.lighthouseapp.com/projects/8994/tickets/2582-actionviewtexthelper-graceful-truncate#ticket-2582-1 This could help, too! :P On Mon, Mar 2, 2009 at 12:57 PM, andrew.ohns...@gmail.com < andrew.ohns...@gmail.com> wrote: > > I have a text field in the db for the body of user posts. User

[Rails] Re: Rails, multiple connections and threads

2009-04-29 Thread Jeff Lewis
Might want to try: ... fork { `ruby #{RAILS_ROOT}/script/some_script.rb` } ... Jeff On Apr 29, 7:57 am, Sudhi Kulkarni wrote: > Hi, > > I have a rails app which currently does the following > > "After the launch of the page, there is a button click which starts > another ruby script on

[Rails] Re: Complex relationships

2009-04-29 Thread Chris Strom
On Tue, Apr 28, 2009 at 10:10 AM, DVG wrote: > > Currently, I have 3 models > User > Group > Permission > > Users and Groups have a HABTM relationship and Groups and Permissions > have a HABTM relationship. > > For purposes of authorization, I need to know if a user belongs to a > particular grou

[Rails] Re: Problem with Rails 2.3.2 on Ubuntu 9.04: libWand.so.10 missing

2009-04-29 Thread ruby.mya...@spamgourmet.com
I just needed to re-install the imagemagick libs and gem and it worked again: sudo apt-get install imagemagick sudo apt-get install libmagick9-dev sudo gem install rmagick On Apr 24, 3:15 am, "michael.hasenst...@googlemail.com" wrote: > Well, for the record, I solved it with a symlink > > /usr/l

[Rails] [ANN] Lone Star Twitter/Ruby Conference 2009

2009-04-29 Thread jimfreeze
Greetings After much feedback about the Lone Star Twitter Conference, it looks like the LSTC will NOT be replacing the Lone Star Ruby Conference after all. Half of the speakers complained that 140 characters was not enough for an interesting talk, and that they needed at least 180. The other

[Rails] customizing generated type names with ActionWebService

2009-04-29 Thread Dan The man
I need a way I can create two different ruby struct classes (MyStructV1, MyStructV2) and have them map to a type which is referred to in the xml as simply 'MyStruct'. V1 and V2 have different fields, and would be served by different controllers. Can this be done? I have tried valiantly to patch a

[Rails] Re: Polymorphic Associations... confusing. Do I need them?

2009-04-29 Thread Chris Hanks
Ah, this looks great! I'll try it out today. Thanks, Dan! -- 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] Rails, multiple connections and threads

2009-04-29 Thread Sudhi Kulkarni
Hi, I have a rails app which currently does the following "After the launch of the page, there is a button click which starts another ruby script on server using system(ruby )" This execution may take a while around 5-10 mins. I have following questions 1. While the script is being executed ar

[Rails] Re: Basic Doubts

2009-04-29 Thread Rob Biedenharn
On Apr 29, 2009, at 8:25 AM, Rodrigo Felix wrote: > I've just started a project and I've been having some basic doubts. > Firstly, I created my db schema using a db modeling tool. Then I > generated the tables according to that model. After I created the > schema.rb. The database.yml is ok

[Rails] XML Builder - problems with serialized ruby

2009-04-29 Thread matt mitchell
Hi, I'm using the Builder gem to transform an array/hash that contains serialized ruby. Builder's to_xs method seems to mangle serialized ruby though. I can get around this by encoding/decoding with base 64, but that doesn't seem like a good path to follow. Builder is using this code for escapin

[Rails] Basic Doubts

2009-04-29 Thread Rodrigo Felix
I've just started a project and I've been having some basic doubts. Firstly, I created my db schema using a db modeling tool. Then I generated the tables according to that model. After I created the schema.rb. The database.yml is ok and also the first migration. My doubt is: when I run *script/gene

[Rails] Re: Polymorphic Associations... confusing. Do I need them?

2009-04-29 Thread Daniel Bush
2009/4/30 Daniel Bush > > > 2009/4/29 Robert Walker > >> >> Daniel Bush wrote: >> > 2009/4/29 Chris Hanks >> > >> >> has_many :examples, :as => :sections >> >> And get: >> >> sections for each tutorial, also, to make sure they appear in the right >> >> order. >> >> >> >> Does that make sense?

[Rails] Re: Polymorphic Associations... confusing. Do I need them?

2009-04-29 Thread Daniel Bush
2009/4/29 Robert Walker > > Daniel Bush wrote: > > 2009/4/29 Chris Hanks > > > >> has_many :examples, :as => :sections > >> And get: > >> sections for each tutorial, also, to make sure they appear in the right > >> order. > >> > >> Does that make sense? I think single table inheritance might d

[Rails] Re: Is mime content type case sensitive?

2009-04-29 Thread Robert Walker
Rick Lloyd wrote: > Simply put, I have a view/new... that accepts an image file and uses > attachment_fu in the model to store the file and thumbnail on the > filesystem. The view/index... puts up the thumbnails as "link_to" > pointing at their respective full size images. I've been feeding in >

[Rails] Re: Controller Instance Variables

2009-04-29 Thread Morgan Christiansson
Hi djolley. You can also use class variables or global variables: test.rb: $b='global value' class MyTest @@a='class value' def class_val @@a end def global_val $b end end test = MyTest.new puts test.class_val puts test.global_val $ ruby test.rb class value global value The

[Rails] Re: Polymorphic Associations... confusing. Do I need them?

2009-04-29 Thread Robert Walker
Daniel Bush wrote: > 2009/4/29 Chris Hanks > >> has_many :examples, :as => :sections >> And get: >> sections for each tutorial, also, to make sure they appear in the right >> order. >> >> Does that make sense? I think single table inheritance might do this, >> but I'm planning on using example

[Rails] Re: Polymorphic Associations... confusing. Do I need them?

2009-04-29 Thread Robert Walker
Robert Walker wrote: > Tutorial << ActiveRecord::Base > has_many :questions > has_many :example > end Oops, sorry for the typo. Should be: has_many :examples -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because y

[Rails] Error while passing values in will_paginate

2009-04-29 Thread Vidhya Raja
Hai to All , I am facing a problem while passing a value in will_paginate.The values are not passed when moving from one page to other in pagination. The coding is, <%= will_paginate @names ,{:territory=>params[:territory],:area=>params[:area],:name=>params[:name]},:renderer => 'RemoteLin

[Rails] Re: Active Record Session expiration in Rails 2.3

2009-04-29 Thread Robert Walker
Robert Walker wrote: > new on ror wrote: >> Hello mate, >> >> I'm wonder how to use database sessions store instead of cookies. >> Rails 2.3 > > environment.rb > -- > config.action_controller.session_store = :active_record_store What I wonder is what are the advantages of using an activ

[Rails] Errno::ECONNREFUSED (Connection refused - connect(2)) Act

2009-04-29 Thread Salil Gaikwad
Hi All, I encountered with following error when i try to send e-mail in production mode. Errno::ECONNREFUSED (Connection refused - connect(2)): /usr/lib/ruby/1.8/net/protocol.rb:206:in `initialize' /usr/lib/ruby/1.8/net/protocol.rb:206:in `new' /usr/lib/ruby/1.8/net/protocol.rb:206:

[Rails] Re: Active Record Session expiration in Rails 2.3

2009-04-29 Thread Robert Walker
new on ror wrote: > Hello mate, > > I'm wonder how to use database sessions store instead of cookies. > Rails 2.3 environment.rb -- config.action_controller.session_store = :active_record_store -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~--

[Rails] Different behaviour on ActiveResorce with JSON or XML

2009-04-29 Thread Paulo Pereira
I'm doing a request from a Rails app to another Rails app with ActiveResource. When the format on ActiveResource is XML: Content.find(:all)[0,2].map(&:attributes) => [ {"updated_at"=>Mon Apr 27 15:04:32 UTC 2009, "url"=>"www.google.com", "id"=>1, "created_at"=>Mon Apr 27 15:04:32 UTC 2009},

[Rails] Techkicks.com technology links, community driven

2009-04-29 Thread Steven
TechKicks.com is a community based technology site. It specializes in Hi-Technologies like Robotics, ERP, GPS, Python, Haskell, Lisp, Ruby On Rails, and common techs like c#, PHP, Java, Sql and many more. Individual users of the site submit and review stories, the most popular of which make it to

[Rails] Re: will_paginate urls and AJAX calls

2009-04-29 Thread Sijo Kg
Hi Can you try like http://www.ruby-forum.com/topic/134632#726021 Sijo -- 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: Send some text as a csv file?

2009-04-29 Thread Max Williams
Perfect, thanks (again!) Fred. I should have worked that out myself really... max -- 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

[Rails] Re: Controller access to POST Data in bulk?

2009-04-29 Thread Denis Haskin
ActionController::Request#body http://api.rubyonrails.org/classes/ActionController/Request.html#M000701 dwh 7stud -- wrote: > Vc Scafati wrote: > >> Hi, >> >> Ruby Newbie here, with a question. I've written rails web app, and I'd >> like to have the controller log the post data into the inf

[Rails] Re: Send some text as a csv file?

2009-04-29 Thread Frederick Cheung
On Apr 29, 10:57 am, Max Williams wrote: > I have a table on a page, and i want a link to download the table data > as a csv.  One way to do this would be to have my model class build a > file, and pass the filename back to the controller, which uses send_file > to send it to the user.  But, th

[Rails] Send some text as a csv file?

2009-04-29 Thread Max Williams
I have a table on a page, and i want a link to download the table data as a csv. One way to do this would be to have my model class build a file, and pass the filename back to the controller, which uses send_file to send it to the user. But, this seems a bit heavy handed - it's a small amount of

[Rails] Re: Driving me nuts!!! - Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

2009-04-29 Thread wejrow...@gmail.com
Wow, ok this solved it: Instead of using: sudo ./bin/mysqld_safe --user=mysql I needed to use: sudo ./bin/mysql_install_db --user=mysql --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. T

[Rails] HTMLDOC Table header row(s) to repeat on subsequent pages

2009-04-29 Thread Dhanuja Dhanuja
Hello, I need to display table headers on each page in the pdf generated using HTMLDOC. For example, my table contains header as Name, Address, Age. It is displayed in first page. When the content of the table extends to next page, only the content is displayed and header is not displayed. If y

[Rails] creating xml in controller and send to Web Service

2009-04-29 Thread Bhargavi Vel
Hi All, I have a question regarding creating xml in controller class.. I am designing a rails application, which is a client for java REST based Web services. in my rails client part, in my view, I have a simple index.html.erb which consists of 2 strings 'source' , 'destination' . I will take the

[Rails] Re: how to combine SQL queries in self.up

2009-04-29 Thread Marnen Laibow-Koser
Vipin wrote: > Hi > > How can i combine multiple SQL statements into one place in self.up in > a migration. [...] You shouldn't need to, at least in the way you're asking about. Write your migrations in Ruby, not raw SQL. Best, -- Marnen Laibow-Koser http://www.marnen.org mar...@marnen.org --

[Rails] Re: Driving me nuts!!! - Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

2009-04-29 Thread Andrew Timberlake
On Wed, Apr 29, 2009 at 8:16 AM, wejrow...@gmail.com wrote: > > I had to put a new HD in, and now I'm reinstalling everything, and > can't get mysql to fully work. I can't remember how I fixed it. I've > searched everywhere online and can't find anything. > > when I try to use the >mysql command