[Rails] Re: Rcov: how to write test cases

2009-02-06 Thread Brijesh Shah
Dharmdip Rathod wrote: > Brijesh Shah wrote: >> Hi I am using rcov to generate code coverage. But I don't know how to >> write cases for that... >> >> I have installed rcov gem and and execute rcov test/*.rb command. It >> shows me some code coverage in files. >> >> Can anyone help me by givin

[Rails] script/plugin install from SVN url with http authentication

2009-02-06 Thread Russell Quinn
How can I use script/plugin install to access a SVN repository that requires HTTP authentication? I've tried: script/plugin install http://[user]:[pa...@svn_rep/project/plugin It works fine with the -x option, but obviously this is using svn:externals Thanks, Russell. -- Posted via http://ww

[Rails] Re: application helper problema

2009-02-06 Thread Eddie Son
did you mean when you put it in your controller's helper file, it works? make sure you are using your helpers in your views, and not in your controller. Chris Habgood wrote: > I am calling a function I made in application_helper but when I try to > call it it keeps saying method undefined. If

[Rails] before_save :strip_whitespace => saves with spaces

2009-02-06 Thread Newb Newb
i used this private function for removing leading and trailing white spaces from the values.that below function would be called before_save. when i print the value after it strips.it prints string without any spaces.but in the table fields it saves with spaces . waht would be the problem.pls help

[Rails] installing ruby-postgres gem

2009-02-06 Thread John Small
I'm starting to look at postgres because I'm going to need it for its GIS extensions. But I run in into a problem when trying to install the ruby-postgres gem. I get this error Building native extensions. This could take a while... ERROR: Error installing ruby-postgres: ERROR: Failed to build

[Rails] Re: Rcov: how to write test cases

2009-02-06 Thread Dharmdip Rathod
Brijesh Shah wrote: > Hi I am using rcov to generate code coverage. But I don't know how to > write cases for that... > > I have installed rcov gem and and execute rcov test/*.rb command. It > shows me some code coverage in files. > > Can anyone help me by giving example that how to write test

[Rails] Re: Regular Expressions for Leading white space

2009-02-06 Thread Mohit Sindhwani
Philip Hallstrom wrote: >> Can Anyone help me with regular expression which checks the string, if >> it contains Leading whitespaces. >> example >> => admin >> it contains leading space with it. >> so i need to check it. >> pls help me. >> > > Read up on the Regex class and pattern matching i

[Rails] application helper problema

2009-02-06 Thread Me
I am calling a function I made in application_helper but when I try to call it it keeps saying method undefined. If I put the function in the controller it runs just fine. any ideas? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the

[Rails] Rcov: how to write test cases

2009-02-06 Thread Brijesh Shah
Hi I am using rcov to generate code coverage. But I don't know how to write cases for that... I have installed rcov gem and and execute rcov test/*.rb command. It shows me some code coverage in files. Can anyone help me by giving example that how to write test cases and where to write... Than

[Rails] Re: Rails Colo in Pacific Northwest?

2009-02-06 Thread s.ross
If it's the Pacific Northwest of USA, try Planet Argon, in Portland. http://planetargon.com/ On Feb 6, 2009, at 7:54 PM, Julian Leviston wrote: > > Pacific northwest of where? I'm on Australia. > > Blog: http://random8.zenunit.com/ > Learn rails: http://sensei.zenunit.com/ > > On 07/02/2009, a

[Rails] Re: Regular Expressions for Leading white space

2009-02-06 Thread Philip Hallstrom
> Can Anyone help me with regular expression which checks the string, if > it contains Leading whitespaces. > example > => admin > it contains leading space with it. > so i need to check it. > pls help me. Read up on the Regex class and pattern matching in general... str = " some string with a l

[Rails] Regular Expressions for Leading white space

2009-02-06 Thread Newb Newb
Can Anyone help me with regular expression which checks the string, if it contains Leading whitespaces. example => admin it contains leading space with it. so i need to check it. pls help me. -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You rece

[Rails] Re: Rails testing uses huge number of AUTO INC ids in db

2009-02-06 Thread Jeffrey L. Taylor
Quoting Rasmus Nielsen : [snip] > Yes I just found out after playing around with mysql's general log. > Thank you for your reply anyway! > > I've decided to change the problematic column data types to int(11) - > rails' default for mysql. The reason I made the (premature) optimization > in the

[Rails] Re: Nested Resources: How to view all children resources

2009-02-06 Thread Eric
you just need to create an un-nested route for tasks: map.resources :tasks outside of the nested routes block. they won't conflict. On Feb 6, 7:59 pm, Adam Akhtar wrote: > I want to be able to view all the children resources in a nested > resoruce scheme. > > Ie. if i have projects and tasks I

[Rails] Re: Strange IRB problem

2009-02-06 Thread Doug
On Feb 6, 7:53 pm, Julian Leviston wrote: > Don't u need to type ruby in front of ruby scripts on windows!? > > Blog:http://random8.zenunit.com/ > Learn rails:http://sensei.zenunit.com/ > Yeah, I used to have to do that.especially in the DOS shell. not sure why that changed. but in this c

[Rails] Hi`

2009-02-06 Thread dragon heart
Hi` -- 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 from t

[Rails] Nested Resources: How to view all children resources

2009-02-06 Thread Adam Akhtar
I want to be able to view all the children resources in a nested resoruce scheme. Ie. if i have projects and tasks I want to be able to view every single task like this /tasks rather than /project/1/task Can anybody help? -- Posted via http://www.ruby-forum.com/. --~--~-~--~~--

[Rails] Re: Rails Colo in Pacific Northwest?

2009-02-06 Thread Julian Leviston
Pacific northwest of where? I'm on Australia. Blog: http://random8.zenunit.com/ Learn rails: http://sensei.zenunit.com/ On 07/02/2009, at 12:22 PM, "william.hard...@gmail.com" wrote: > > Does anyone have any experience with or knowledge of a Rails-savvy > colocation facility in the vicinity o

[Rails] Re: Strange IRB problem

2009-02-06 Thread Julian Leviston
Don't u need to type ruby in front of ruby scripts on windows!? Blog: http://random8.zenunit.com/ Learn rails: http://sensei.zenunit.com/ On 07/02/2009, at 12:06 PM, Doug wrote: > > very strange > I'm on Vista and updated to Rails 2.2.2 and rubygems 1.3.1 with the > usual problem there. >

[Rails] Re: collection_select :selected (to get a default value into

2009-02-06 Thread Julian Leviston
I'm a little unsure as to what you want to do? Is it that you want a default value and then to retain their selected value? Or something else. I remember understanding collection select took me a while. It helps if you can do the HTML long hand once through to get clear about exactly what

[Rails] nested links for show, edit and delete

2009-02-06 Thread Nick Bhanji
I am trying to use wice grid plugin and I have run into problem. The problem is when I have nested paths as follows: Hardware :has_many installed_softwares Software :has_many installed_softwares installed_softwares belongs_to both when I view individual hardware, I have a link "Installed Soft

[Rails] Re: script/server -- responding to multiple request simultaneously?

2009-02-06 Thread Ryan Bigg
You could use passenger for this (an apache module), http:// modrails.com. - Ryan Bigg Mocra - Premier iPhone and Ruby on Rails Consultants w - http://mocra.com e - ra...@mocra.com p - +61 432 937 289 or +61 7 3102 3237 skype - radarlistener On 07/02/2009, at 12:09 PM, Jacob Refstrup

[Rails] Simple form with option to go to advanced form

2009-02-06 Thread Adam Akhtar
I have a todo list involving projects and tasks and im using nested resources. In Projects Show - i list all tasks associated with the project. I also have a simple "add task" which allows the user to add a task but only specify the title. Other attributes are set to default (e.g. due date = None,

[Rails] Re: grep-like search help

2009-02-06 Thread Ralph Wood
Simon Macneall wrote: >but that will get messy the more words you have in your > search. Yeah, I was figuring I was gonna have to do something like an 'explode' with the search terms at some point. -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~

[Rails] Re: grep-like search help

2009-02-06 Thread Simon Macneall
isn't that just the condition 'sentence like %bird%door%'? Although that will only get them where they appear in that particular order. You could interate all the possibilities ie conditions => ['sentence like %bird%door% or sentence like %door%bird%'] but that will get messy the more words

[Rails] grep-like search help

2009-02-06 Thread Ralph Wood
Hello, noob here. I have a table called 'entries' with lots of sentences, one per row (id). I need to find specific sentences that have the words I'm looking for anywhere in them. For example: >1. The bird entered the kitchen through the door. > >2. You left the door of your car open. > >3. Clos

[Rails] script/server -- responding to multiple request simultaneously?

2009-02-06 Thread Jacob Refstrup
Hi, I'm trying to see if there's an easy way that I can get script/server to process multiple requests simultaneously? Why you might ask... well I'm developing a web app that sits on top of several web services and for development expediency I'm trying to "host" them all on the same host:post.

[Rails] Re: Trying out TDD, getting stuck!

2009-02-06 Thread Nelson Hsu
Oops... I forgot the actual fix. The fix was to comment out: fixtures :all -- 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 gr

[Rails] Re: Trying out TDD, getting stuck!

2009-02-06 Thread Nelson Hsu
Well, I figured it out, so I'm going to update my thread and hopefully help someone in the future. The problem was in test_helper.rb on this line: fixtures :all Anyways, thanks for everyone's responses. And thanks to Phlip's suggestion about starting out with unit tests. They were much eas

[Rails] Rails Colo in Pacific Northwest?

2009-02-06 Thread william.hard...@gmail.com
Does anyone have any experience with or knowledge of a Rails-savvy colocation facility in the vicinity of the Pacific Northwest? Thanks! Bill --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" grou

[Rails] scalable file uploads with Rails

2009-02-06 Thread Mr_Tibs
Hi, I'm involved in a project where I have to re-architect file uploads in a Rails application to make it scalable. Users will be uploading large XML files (approx. 1MB) with high probability of overlap (upload at the same time) - which we try to minimize. The current system runs Mongrel cluster

[Rails] Strange IRB problem

2009-02-06 Thread Doug
very strange I'm on Vista and updated to Rails 2.2.2 and rubygems 1.3.1 with the usual problem there. ...but that's well documented... everything was finebut then I tried the irb console. in every shell I have (netbeans, git bash, windows shell) I got this result: ---

[Rails] xml special characters

2009-02-06 Thread Grayson Piercee
Hello, I need to produce XML that looks like this Image Title Description of my Image http://www.mywebsite.com/image.jpg"; /> http://www.mywebsite.com/image_thumb.jpg"; /> but rails doesn't seem to like the ":" in the following code for

[Rails] Re: Rails testing uses huge number of AUTO INC ids in db

2009-02-06 Thread Rasmus Nielsen
John Barnette wrote: > Hi, > > On Fri, Feb 6, 2009 at 11:07 AM, Rasmus Nielsen > wrote: >> MEDIUMINT (as opposed to rails' standard INT in mysql) to save memory >> consumption on our db-server. When running a test these column is being >> "maxed out" and hence the tests produce unusable results.

[Rails] HTTPS and Deployment Basics

2009-02-06 Thread Neal L
Hi all, Does anyone know of a good tutorial / walkthrough on how to setup a production server to use HTTPS? I've got a development server running Apache with Phusion Passenger, but don't know how to make the leap to deployment... Thanks in advance for the suggestions! --~--~-~--~~--

[Rails] Re: Help with Forms

2009-02-06 Thread Colin Law
Probably nothing to do with your problem but html does not allow between and though some browsers do not object. It is not allowed between and either. 2009/2/6 Jej > > > > Maybe a stupid remark: I don't see any submit button in your form... > > > > However, this is not working at all. The v

[Rails] gahh! how do you install the query_trace plugin?

2009-02-06 Thread dino d.
Hello- I am trying to install the query_trace plugin here: http://github.com/ntalbott/query_trace/tree/master I can't figure out how to install it. I've tried script/install plugin, I've tried svn, I've tried downloading the files and placing them in the vendor/plugins directory, nothing seems

[Rails] Re: Help with Forms

2009-02-06 Thread Jej
Maybe a stupid remark: I don't see any submit button in your form... > However, this is not working at all. The view renders fine. But I am > not sure why the id that is passed to the controller is totally out of > whack. I have tried the following hash in the controller and it gives > me an e

[Rails] Re: Ruby EE: Problem with BigDecimal

2009-02-06 Thread Marnen Laibow-Koser
Carsten Gehling wrote: > *sigh* > > I found only one solution: I converted all my decimal fields in the DB > to varchar, and rewrote my code to make sure the value was converted > to BigDecimal before used in calculations. > Two thoughts: 1. Use composed_of to make the process of String conversi

[Rails] uninitialized constant error - Using unconventional table names

2009-02-06 Thread loominator1970
Hello, I'm having some trouble with an association between two tables in my RoR site. It looks like Rails is attempting to truncate the name of my model so that it can fit the normal model conventions. Any idea how I can override this? The error: uninitialized constant Project::ProjectProgres

[Rails] Re: form_for + catch the complete action

2009-02-06 Thread Daly
Sorry about the delay: I found a nice tutorial here: http://www.railsillustrated.com/screencast-file-uploads-progress-in-rails-passenger.html On Feb 5, 12:37 pm, Mathieu Rousseau wrote: > I already used responds_to_parent successfully. > > What are the better alternatives if we use Apache and P

[Rails] Re: Create a Trial Period then have an initial charge first time.

2009-02-06 Thread Pau Cor
Sean McGilvray wrote: > I am looking to see of someone has created a setup that will allow for > a trial period of 30 days without collecting payment info up front. > > On the 30th day charge one fee (i.e. 4.95 + 9.95 setup fee) > > Then charge 4.95 a month after that. > > If you know how to do

[Rails] Re: A working from_xml including child relationships...

2009-02-06 Thread adamfowleruk
Oh BTW just added recursive to_xml too, which supports ActiveRecord::Base objects http://web.me.com/adamfowleruk/adamsapple/Blog/Entries/2009/2/6_Ruby_to_xml_implementation.html Adam. On Feb 6, 5:29 pm, adamfowleruk wrote: > Hi all, > > I've been looking at some options for getting a from_xml

[Rails] gem update issues

2009-02-06 Thread Greg Donald
1) Why does `gem update` install Rails 2.3.0 when it's not been released yet? 2) Why does `gem update` install Rails (2.3.0) on one of my servers but sticks with 2.2.2 on another server? Same Linux distro, same ruby version, same gem version. Thanks, -- Greg Donald http://destiney.com/ --~

[Rails] Re: Rails testing uses huge number of AUTO INC ids in db

2009-02-06 Thread John Barnette
Hi, On Fri, Feb 6, 2009 at 11:07 AM, Rasmus Nielsen wrote: > I've recently begun writing tests in rails and I've run into a problem. > > After recreating my test-database and running my few tests ONCE the auto > increment ID setting for some of the tables in the test-database is set > to a very

[Rails] Full Ajax Application

2009-02-06 Thread Geekyra
Hello, I'm a newbie here... please... can anyone help me about FULL AJAX ? for example if i'm scaffolding a simple model and controller for product which only have 1 field for NAME:STRING with the command : script/generate scaffold Product name:string and for the generated code I like to turn it

[Rails] Rails testing uses huge number of AUTO INC ids in db

2009-02-06 Thread Rasmus Nielsen
Hi there, I've recently begun writing tests in rails and I've run into a problem. After recreating my test-database and running my few tests ONCE the auto increment ID setting for some of the tables in the test-database is set to a very high number, as in: .. ) ENGINE=InnoDB AUTO_INCREMENT=84154

[Rails] Re: Ruby EE: Problem with BigDecimal

2009-02-06 Thread Carsten Gehling
*sigh* I found only one solution: I converted all my decimal fields in the DB to varchar, and rewrote my code to make sure the value was converted to BigDecimal before used in calculations. - Carsten -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~

[Rails] Re: collection_select :selected (to get a default value into

2009-02-06 Thread Steve Davie
Frederick Cheung wrote: > On 6 Feb 2009, at 16:55, Steve Davie wrote: > > <% end %> collection_select ignore the :selected option. >>> should add that this will change in 2.3 >> >> Thanks for the info Fred, but do you know of any convention for >> handling >> this kind of pro

[Rails] Re: collection_select :selected (to get a default value into

2009-02-06 Thread Frederick Cheung
On 6 Feb 2009, at 16:55, Steve Davie wrote: > > Frederick Cheung wrote: >> On 6 Feb 2009, at 16:47, Frederick Cheung wrote: >> <% if params[:cruise_info] %> <%= collection_select :cabin_type, :cabin_type_id, CabinType.find_by_status(1).collect {|ct| ct}, :id, :name, {:se

[Rails] Ruby on rails Developer required for my London Agency

2009-02-06 Thread jcb...@googlemail.com
Please call me on 02085452110 or drop me your CV to j...@alan-morris.com Must be a client facing RoR dev with a couple of years experience. Many thanks http://www.linkedin.com/in/jamescblayamrphp --~--~-~--~~~---~--~~ You received this message because you are subsc

[Rails] Re: How does something like ...sort_by(&:f) actually manage to function?

2009-02-06 Thread balint . erdi
The first of the parameters passed to the block is the object that is sent the message designated by the symbol. (Or in other words, the method designated by the symbol is called on the object that is the first parameter). So people.collect(&:name) works because the collect iterator yields a memb

[Rails] A working from_xml including child relationships...

2009-02-06 Thread adamfowleruk
Hi all, I've been looking at some options for getting a from_xml implementation working with ActiveRecord based classes. I had a few issues and couldn't resolve them, so I rolled my own. Seems to work well for simple parent > child relationships, including collections. I thought I'd post in case

[Rails] Help with Forms

2009-02-06 Thread frank95a
Hello all, I am a newbie in Rails and have been trying to solve the following by myself for the past 3 days to no avail. Any help is appreciated. Here is what I am trying to do: 1. Run a search on a table 2. Create a form that will update one attribute per record within the result set Here is

[Rails] Re: collection_select :selected (to get a default value into

2009-02-06 Thread Frederick Cheung
On 6 Feb 2009, at 16:35, Steve Davie wrote: > > I'm getting murdered by this thing! For the life of me, I can't > figure > it out. I've spent literally days on google. > > Here's what I would like to do (in rails 2.2.2): > > > <% if params[:cruise_info] %> > <%= collection_select :cabin_type

[Rails] Re: collection_select :selected (to get a default value into

2009-02-06 Thread Steve Davie
Frederick Cheung wrote: > On 6 Feb 2009, at 16:47, Frederick Cheung wrote: > >>> >>> <% if params[:cruise_info] %> >>> <%= collection_select :cabin_type, :cabin_type_id, >>> CabinType.find_by_status(1).collect {|ct| ct}, :id, :name, >>> {:selected => >>> params[:cruise_info][:cabin_type_id]}%>

[Rails] Re: collection_select :selected (to get a default value into

2009-02-06 Thread Frederick Cheung
On 6 Feb 2009, at 16:47, Frederick Cheung wrote: > > On 6 Feb 2009, at 16:35, Steve Davie wrote: > >> >> I'm getting murdered by this thing! For the life of me, I can't >> figure >> it out. I've spent literally days on google. >> >> Here's what I would like to do (in rails 2.2.2): >> >> >> <

[Rails] Re: How does something like ...sort_by(&:f) actually manage to function?

2009-02-06 Thread Kenneth McDonald
OK, I see how this works now, but I can't figure out how to get extra args in there, i.e. something like [1, 2, 3].collect(&:modulo, 2) doesn't work because it's improper Ruby syntax. I assume there's a reason extra args are allowed, so could someone give a brief illustration of the calling

[Rails] collection_select :selected (to get a default value into

2009-02-06 Thread Steve Davie
I'm getting murdered by this thing! For the life of me, I can't figure it out. I've spent literally days on google. Here's what I would like to do (in rails 2.2.2): <% if params[:cruise_info] %> <%= collection_select :cabin_type, :cabin_type_id, CabinType.find_by_status(1).collect {|ct| ct},

[Rails] Re: How does something like ...sort_by(&:f) actually manage to function?

2009-02-06 Thread Frederick Cheung
On 6 Feb 2009, at 15:58, Kenneth McDonald wrote: > > OK, I see how this works now, but I can't figure out how to get extra > args in > there, i.e. something like [1, 2, 3].collect(&:modulo, 2) doesn't work > because > it's improper Ruby syntax. I assume there's a reason extra args are > allowed,

[Rails] Re: Attachment fu plugin image upload

2009-02-06 Thread Mathieu Rousseau
It allows 1 - n ? Can I have a list of attachments associated to the model? or you have to add each attachment? On Fri, Feb 6, 2009 at 1:14 PM, Andrew Timberlake < and...@andrewtimberlake.com> wrote: > On Fri, Feb 6, 2009 at 3:23 PM, Mathieu Rousseau < > mathieu.rousseau...@gmail.com> wrote: > >>

[Rails] Re: What is the url for my public folder

2009-02-06 Thread Shandy Nantz
I do seemed to be getting blocked by my controller. The issue that I am having is that I am sending emails out with embedded html and I am having trouble sending the style sheets along with the email. What I thought I could do was simply reference the style sheet via the url, but I have encoun

[Rails] Re: content_for only works inside a yield?

2009-02-06 Thread Stephen
Has Anyone found a solution to this? My setup is like this layout (pseudo-code) <%= yield : head %> <%= render :partial => 'home/menu' %> <%= yield %> In my partial I have: <% content_for :head do %> someJavaSCript <% end %> Some Html blah blah.. And it is not renderin

[Rails] Re: How does something like ...sort_by(&:f) actually manage to function?

2009-02-06 Thread Kenneth McDonald
Thank you! Ken On Feb 5, 2009, at 6:13 PM, balint.e...@gmail.com wrote: > > It is not possible in "plain" ruby because Rails extends the Symbol > class with the possibility of converting it into a Proc (that's what > happens when you precede something with a &). From the Rails source > code: >

[Rails] Re: Updating with Paperclip

2009-02-06 Thread Tony Chauveau
> "_method"=>"put", "action"=>"update", "spec"=>{"photo"=>"Blue-Wild- > Flower-1-1024x768.jpg"}, "id"=>"10", "controller"=>"spec"} If you can see the file name and not something like : "photo"=># There's a mistake. Maybe you forgot the multipart on the form? -- Posted via http://www.ruby-forum

[Rails] Re: IP Address regex

2009-02-06 Thread Chris Warren
Newb Newb wrote: > Hi.. > > I want to check for correct ip address while i submit the form. > When i used below regular expression.it accepts 0.0.0.0 as ip address > value. > REGEXP_HOST_ADDRESS > =/\A(?:25[0-5]|(?:2[0-4]|1\d|[1-9])?\d)(?:\.(?:25[0-5]|(?:2[0-4]|1\d|[1-9])?\d)){3}\z/. > But in my c

[Rails] Re: Attachment fu plugin image upload

2009-02-06 Thread Andrew Timberlake
On Fri, Feb 6, 2009 at 3:23 PM, Mathieu Rousseau < mathieu.rousseau...@gmail.com> wrote: > I used both: as far as I know paperclip only permits you to have 1 > attachment per model. attachment_fu is more flexible about this. > am I wrong? > Paperclip allows more than one attachment per model And

[Rails] Re: Prawn: text at horizontal middle of the page

2009-02-06 Thread Tom Lobato
Solved! I had to use bounding box to position the text. The trick is to use the bounding_box parameters: :width => bounds.width, :height => bounds.height instead :width => 800, :height => 600 now prawn center the text exactly. See all the code... Prawn::Document.generate("Certificado.pdf",

[Rails] Re: update_attributes not working on production environment

2009-02-06 Thread Hema
I uninstalled rails 2.2.2 in my associations folder of activerecord 2.1.0 there is no method like transfer/change any one please help me.. I am unable to proceed furthur On Feb 5, 11:31 am, Hema wrote: > Hi, > >   Where I have to check in vendor directory > >   I have the plugins directory only

[Rails] Re: How to create date obj?

2009-02-06 Thread MaD
try it like this: date = DateTime.civil(y=from_year, m=from_month, d=from_month, min=from_time.min, s=from_time.sec, of=0) here is the according ruby-api: http://www.ruby-doc.org/core/classes/DateTime.html --~--~-~--~~~---~--~~ You received this message becaus

[Rails] Re: IP Address

2009-02-06 Thread Craig Demyanovich
There's a good write-up here: http://www.regular-expressions.info/numericranges.html While not specific to matching an IP address, it does cover how to match ranges like 0-255. Regards, Craig --~--~-~--~~~---~--~~ You received this message because you are subscri

[Rails] prepend_view_path and layouts

2009-02-06 Thread Joost
When using prepend_view_path in a before_filter in application_controller it renders all views correctly from the added view path. However layouts are still from the default location.. Any ideas? --~--~-~--~~~---~--~~ You received this message because you are subsc

[Rails] Re: How to create date obj?

2009-02-06 Thread Julian Leviston
Look up the date class in the prag prog's book. It explains how to create dates. Date.new(2008,12,30) for example. Blog: http://random8.zenunit.com/ Learn rails: http://sensei.zenunit.com/ On 06/02/2009, at 8:42 PM, Sunny Bogawat wrote: > > Hi, > > In one of my application i have to create a

[Rails] Re: Autocomplete plugin with Rails 2.0

2009-02-06 Thread Gerrit Lewedag
> use :except instead of :exclude > > => protect_from_forgery :except => [:auto_complete_for_tag_name] http://api.rubyonrails.org/classes/ActionController/RequestForgeryProtection/ClassMethods.html#M000493 -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~-

[Rails] Re: What is the url for my public folder

2009-02-06 Thread Sazima
Shandy, Phlip is too concise, but right. The URL of your public folder is www.mysite.com/ So www.mysite.com/images/1.gif is the URL for the file 1.gif in the images directory of your public folder. Got it? Nonetheless, your public folder is just for your static assets. Rails actions are handled

[Rails] Re: Autocomplete plugin with Rails 2.0

2009-02-06 Thread Gerrit Lewedag
Eric Pugh wrote: > I tried out adding the exclude line: > > protect_from_forgery :only => [:tag] > > However, it seems ugly that I have to add each method manually. I > tried > > protect_from_forgery :exclude => [:auto_complete_for_tag_name] > > but that didn't work. Is this oddness

[Rails] Re: 500/Timeout when trying to send an email with my app?

2009-02-06 Thread Chris Hanks
Ah! All it needed was: ActionMailer::Base.delivery_method = :sendmail I was sure I was missing something obvious. Thanks for your help! Chris -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are subscribed to

[Rails] Re: Attachment fu plugin image upload

2009-02-06 Thread Mathieu Rousseau
I used both: as far as I know paperclip only permits you to have 1 attachment per model. attachment_fu is more flexible about this. am I wrong? On Fri, Feb 6, 2009 at 10:17 AM, tschundeee wrote: > > I tried attachment_fu and paperclip and I can only recommend > paperclip... I think it's easier a

[Rails] I18n and css

2009-02-06 Thread Belén
Is there any way to add some class of the css stylesheet to the text that you want to translate?? Exemple: what: txt: " Exemple" Thanks in advance Belen --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Ra

[Rails] Re: Attachment fu plugin image upload

2009-02-06 Thread tschundeee
I tried attachment_fu and paperclip and I can only recommend paperclip... I think it's easier and more rails-like :-) To your question: This guide looks good: http://www.flex888.com/122/multiple-file-upload-with-ruby-on-rails-acts_as_attachment.html I have in mind that acts_as_attachment and attac

[Rails] Re: Prawn: text at horizontal middle of the page

2009-02-06 Thread Tom Lobato
Hello Greg! at first, congratulations! very nice work! funny, today a tried again to subscribe to the prawn group and noted the "r u a human?" question. So I subscribed and returned here, in the rails talk, to copy my msg to there, then I saw you reply :) well, here we go... On 29 jan, 16:11, G

[Rails] Re: Complex forms + DHH's auto_complete plugin = works!

2009-02-06 Thread Pat
Hi... I wrote some similar code, and packaged it up into a plugin. See: http://patshaughnessy.net/repeated_auto_complete I also know there are a few other forks of the auto_complete plugin that also solve this same problem, for example: http://warrenseen.com/blog/2009/01/16/rails-auto-complete-wi

[Rails] online dictionary

2009-02-06 Thread sugad_d
Can someone point me in the right direction. Is it possible to use ROR for an online dictionary similar to dictionary. com? If so, what is required to do this? Can it manage xml data and generate virtual pages to improve performance? Please advise. Is there another CMS or framework better suited

[Rails] Namespaced resource generation with resource_controller

2009-02-06 Thread Mathieu Rousseau
Hello, I've tried to generate a resource using a pre-defined namespace (admin), but it seems i could not make it work out of the box. I've managed to do it with pretty few hacking step and made a post out of my experience: http://rails.anyware-technologies.com.br/2009/01/19/namespaced-resource-ge

[Rails] Re: 500/Timeout when trying to send an email with my app?

2009-02-06 Thread Julian Leviston
Sorry debt read enough of the mail. Badicall it's timing out when sending touour SMTP server. Are u sure the settings are right? Blog: http://random8.zenunit.com/ Learn rails: http://sensei.zenunit.com/ On 06/02/2009, at 9:24 PM, Chris Hanks wrote: > > Hello - > > I'm kind of new to this who

[Rails] Re: 500/Timeout when trying to send an email with my app?

2009-02-06 Thread Julian Leviston
What method of sending mail are you using? Check your logs while you sen the mail. Blog: http://random8.zenunit.com/ Learn rails: http://sensei.zenunit.com/ On 06/02/2009, at 9:24 PM, Chris Hanks wrote: > > Hello - > > I'm kind of new to this whole web development thing - I have a VPS and >

[Rails] Re: small doubt HELP me

2009-02-06 Thread Julian Leviston
You're right I skim them. Sorry about that. Didn't realize you could use do there. It's definitely optional tho. I fail :) thanks, I learn something. Blog: http://random8.zenunit.com/ Learn rails: http://sensei.zenunit.com/ On 06/02/2009, at 10:58 PM, MaD wrote: > > hallo julian, > > you a

[Rails] Re: small doubt HELP me

2009-02-06 Thread MaD
hallo julian, you already said the following: > You don't need a do when you're using for in you're right on that one, but you don't have to tell me twice: > For...in doesn't take do! especially as this is just wrong. try it yourself: for number in [1, 2, 3] do puts number end > Obvious

[Rails] Re: Rails not installed on CentOS 5.2

2009-02-06 Thread Paryank
Can anyone please give me the solution? I am newer to Rails! On Feb 6, 9:02 am, Paryank wrote: > Can anybody give me the solution??? > > On Feb 5, 3:07 pm, Paryank wrote: > > > Hi > > > I have installed CentOS 5.2 on my PC. I have build in Ruby 1.8.5 and > > Ruby-devel. I have downloaded rubyge

[Rails] Re: Attachment fu plugin image upload

2009-02-06 Thread Peter De Berdt
On 06 Feb 2009, at 10:26, Cyrus Dev wrote: > Anybody know how to upload multiple images using attachment fu plugin attachment_fu is a model plugin, so it has nothing to do with multiple file upload. That said, a simple google search brings up plenty of tutorials on how to handle it in views

[Rails] Re: Using partials with form_for

2009-02-06 Thread Frederick Cheung
On 6 Feb 2009, at 10:06, Sahil Dave wrote: > hi all > > i was wondering whether it is possible to use partials along with > form_for and form_field. following code is not working. is there > some error or this case is impossible..?? > You need to pass the form builder object to the partial (

[Rails] file opening and ajaxing

2009-02-06 Thread Sarika Patil
Hi, I m having a problem with refreshing the page once my data is sent using send_file. how to achive it plz help Thanks in advance -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Googl

[Rails] Re: Can't download files with send_data or send_file

2009-02-06 Thread Sarika Patil
for filename specify your filename directly with filepath for e.g @filepath = "C:/Rails application/smartime/public/excel/"+"report8.xls" and then pass this variable for filename It might work Siva wrote: > I tried the same in my code. But always the browser is getting only > the action name

[Rails] 500/Timeout when trying to send an email with my app?

2009-02-06 Thread Chris Hanks
Hello - I'm kind of new to this whole web development thing - I have a VPS and I've installed ubuntu 8.04 and postfix on it, and now I'm deploying simple rails apps to get the hang of the whole process. So I put together a small forum application, based on the restful_authentication plugin. I've

[Rails] Using partials with form_for

2009-02-06 Thread Sahil Dave
hi all i was wondering whether it is possible to use partials along with form_for and form_field. following code is not working. is there some error or this case is impossible..?? *#new.html.erb* Enter Details for new Partner: <% form_for(@partner) do |f| %> <%= render :partial => 'form', :lo

[Rails] How to check AR connection is established?

2009-02-06 Thread Valentino Lun
I use the following method to remove the AR connection. MyClass.remove_connection However, I use connected? to check, it return true... MyClass.connected? => true Am I used the wrong method? Please advise Thank you. Valentino -- Posted via http://www.ruby-forum.com/. --~--~-~--~

[Rails] Weird mime type set by render_to_string (Rails 2.2 / 2.3)

2009-02-06 Thread Joost
When using 'render_to_string' in your views (for some special reason :) ) the response.content_type is set to the wrong value I think. I have a: respond_to do |format| format.js {} end which in the view uses the render_to_string method. The returned content type is 'text/html' instead of 'tex

[Rails] How to create date obj?

2009-02-06 Thread Sunny Bogawat
Hi, In one of my application i have to create a date obj like 2009-02-05 23:26:35 but for this i have following input which is integer. form_day = 05, from_month = 02 from_year= 2009 and from_time=12:00:00 Please suggest a best solution for it? -- Posted via http://www.ruby-forum.com

[Rails] Re: Acts_as_authentificated signup problem don't understand

2009-02-06 Thread gundest...@gmail.com
look in your configs/enviroments/ you see the following files: production.rb <- correct this file to debig = true, look at your development for instriration... test.rb development.rb regards svend On Feb 5, 7:12 pm, Achille Pinson wrote: > I have follow the wiki. > Everything was working perf

[Rails] Attachment fu plugin image upload

2009-02-06 Thread Cyrus Dev
Hello Everyone, Anybody know how to upload multiple images using attachment fu plugin thanks in advance -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Tal

  1   2   >