Re: [Rails] Rails isn't running on Windows

2015-10-15 Thread Simon Macneall
What's your actual deployment environment? We deploy to linux, so do all our development in linux VMs. Host computer can then be either mac or windows (or linux) and you can still do your development on the correct version of everything else. Cheers Simon On Fri, 16 Oct 2015 08:40:11 +0800

Re: [Rails] What would be a good hosting plan for hosting several Rails projects?

2013-07-25 Thread Simon Macneall
We have Several VPSes set up with crucial paradigm. Depending on number of CPU and RAM etc the price can vary. We host up to 20 different Rails instances on the larger servers and about 5 on the smaller. It'll all depend on how heavy the usage is on the applications as to which way you go.

Re: [Rails] rails and vpn

2013-07-21 Thread Simon Macneall
Hi, I'd assume that the vpn has a specific IP address? I'd just check for that address in the request and if it's not from that address, send it to an error/instruction page. Simon On Mon, 22 Jul 2013 06:03:21 +0800, oto iashvili wrote: Hi, I have a page on my rails website that shou

Re: [Rails] rubyXL error - uninitialized constant RubyXL (NameError)

2013-06-29 Thread Simon Macneall
don't you need to require rubygems as well when running from a script? On Sun, 30 Jun 2013 11:30:21 +0800, Muthu Selvan wrote: *sudo gem install rubyXL* -> *EMPTY RESULT * * * *So installed rubyXL with the below command ...* * * Fetching: rubyXL-1.2.10.gem (100%) Successfully instal

Re: [Rails] Best library for reading/wriiting excel in ruby

2013-06-15 Thread Simon Macneall
yes, it's pure ruby - we are using it on linux On Sun, 16 Jun 2013 11:08:17 +0800, Muthu Selvan wrote: Thanks simon , I am planning to use in mac environment , will it work ..? kindly share if you have good link for start using this .? Thanks in advance , Muthu Selvan SR On Saturday, 15

Re: [Rails] Best library for reading/wriiting excel in ruby

2013-06-15 Thread Simon Macneall
Hi Muthu, We are using RubyXL. It has some limitations but works in general. Cheers Simon On Sun, 16 Jun 2013 10:04:20 +0800, Muthu Selvan wrote: Hi All , I am new for ruby programming and using ruby for automation work . Planned to implement READ / WRITE excel function in ruby , ca

Re: [Rails] Dynamically create databases?

2013-04-04 Thread Simon Macneall
We have toyed with creating separate databases for each customer as our combined one is starting to get quite large. In our case, the models will always be the same no matter which database you are connecting to, so there isn't any meta-programming involved. It's just a case of switching da

Re: [Rails] wss4r

2013-03-22 Thread Simon Macneall
n the exploratory phase and haven't already looked at it, have a look at the savon gem. It is probably the most well-maintained and Active of the SOAP gems and your best bet if you want to build upon SOAP. https://github.com/savonrb/savon On 22/03/13 14:10, Simon Macneall wrote: Hi

[Rails] wss4r

2013-03-21 Thread Simon Macneall
Hi all, Has anyone managed to get wss4r to work? Everything I do (install gem, download source and run setup.rb) still results in a "`gem_original_require': no such file to load -- wss4r (MissingSourceFile)" error. I can see that the gem installed, but just can't the server/console to fin

Re: [Rails] wickedpdf

2012-09-11 Thread Simon Macneall
Have you set the exe path in the initializer? You need to tell wickedpdf where the wkhtmltopdf binary is On Tue, 11 Sep 2012 19:59:51 +0800, keerthi priya wrote: yeah i have installed as a plugin . the code is in vendor folder On Tue, Sep 11, 2012 at 5:24 PM, Jim Ruther Nill wrote:

Re: [Rails] Re: Export data to PDF

2012-02-20 Thread Simon Macneall
You only need to do that for development (when you are testing PDF export). Your production system should already be running multiple instances (otherwise only one person can view your site at a time) all on the same url. On Mon, 20 Feb 2012 21:35:33 +0800, Nitin Mathur wrote: Thanks

Re: [Rails] Re: Export data to PDF

2012-02-20 Thread Simon Macneall
If you are running wkhtmltopdf in debug mode, you need to run a separate mongrel and point the wkhtmltopdf to that url, otherwise it tries to hit your mongrel instance, which is waiting for wkhtmltopdf to finish running. Cheers Simon On Mon, 20 Feb 2012 18:58:45 +0800, Nitin Mathur wrote:

Re: [Rails] WEB SERVICES

2012-01-25 Thread Simon Macneall
We use soap4r for consuming simple web services, Handsoap for slightly more complex services, and for some truly evil IBM web services, we rolled a custom java command line app that we called from rails. Simon On Thu, 26 Jan 2012 07:46:36 +0800, Adrian Caceres wrote: I think to deploy

Re: [Rails] Putting data at soap header

2011-06-20 Thread Simon Macneall
Hi, Have a look here - https://www.ruby-forum.com/topic/86107 You need to create your own Header handler and inject the data through that. Cheers Simon On Tue, 21 Jun 2011 05:11:32 +0800, Rander wrote: Hello everybody, I need help! :( I need to communicate through webservice, but I need

Re: [Rails] Re: How to process hacking attempts?

2011-01-09 Thread Simon Macneall
I wouldn't bother doing that from Rails. That'd be easier to set up either at the firewall or web server level. Would use a lot less resources. Simon On Sun, 09 Jan 2011 19:35:23 +0800, Fritz Trapper wrote: I guess, I simply should send a 404. Since my server needs to be accessable from

Re: [Rails] Re: Whats a good way to avoid nil lookup errors

2010-09-05 Thread Simon Macneall
What about @user = User.find(:first, :conditions => {:id => 1}) if (@user) blah, blah, blah end It's longer to type, but returns nil if the user doesn't exist. On Sun, 05 Sep 2010 21:21:25 +0800, Michael Pavling wrote: @user = User.find(1) if User.exists?(1) I don't like doing two look

Re: [Rails] Re: Can't seem to install RMAGICK on Ubuntu Karmic Koala

2010-04-29 Thread Simon Macneall
then I am out of ideas, sorry :) On Fri, 30 Apr 2010 08:17:16 +0800, ct9a wrote: hi, Simon, 1. when I checked mkmf.log, there were no errors but a bunch of "yes" 2. don't know why but i cannot find the mkmf.log file now -- You received this message because you are subscribed to the Google

Re: [Rails] Can't seem to install RMAGICK on Ubuntu Karmic Koala

2010-04-29 Thread Simon Macneall
I seem to remember something similar when I was installing it on Karmic ages ago. If you go look in the mkmf.log that it talks about (can't remember where it is located) it indicates what the problem was. Mine was to do with other libs that needed to be installed. Things like build-essentials

Re: [Rails] Re: Cut first x pages from a PDF file

2010-04-25 Thread Simon Macneall
I don't think that you can explicitly do that with pdftk, but you can do 'burst' to break the pdf out into lots of single page documents, and then 'cat' to combine the pages that you want in the final document. Simon On Sun, 25 Apr 2010 21:46:23 +0800, jhaagmans wrote: Hi Vladimir, Th

[Rails] Rails on DB2

2010-04-21 Thread Simon Macneall
Hi, We have a potential requirement to convert our existing rails app to run on DB2. I've had a bit of a look around and there is a DB2 active record gem. Does anyone have any experience with this? Is it a robust solution (if not, I can push back at the powers that be)? Thanks Simon -- Y

Re: [Rails] Display human readable time

2010-03-07 Thread Simon Macneall
On Sun, 07 Mar 2010 17:46:40 +0800, Colin Law wrote: On 7 March 2010 09:19, Joshua Partogi wrote: Hi everyone. Does anybody know a good plugin for displaying a human readable time. I like the ones on github. Django also has this built in, but I can not find it for rails. Can anybody tell m

Re: [Rails] Re: Please Help: Accessing Ruby app brings up Apache test page

2010-02-27 Thread Simon Macneall
ypo'd when I was removing my actual IP address. The website is accessible without problems, except Ruby is not loading up. Is there any way I can test if Ruby is indeed installed correctly? What could I be missing? Thanks. On Feb 27, 7:02 am, "Simon Macneall" wrote: Shou

Re: [Rails] Re: Please Help: Accessing Ruby app brings up Apache test page

2010-02-27 Thread Simon Macneall
Shouldn't the virtual host be Note the colon? Cheers Simon On Sat, 27 Feb 2010 16:22:20 +0800, rezilient wrote: Any ideas? Thanks for any advice. On Feb 25, 9:09 pm, rezilient wrote: Hello. I finally got Ruby, Gem and Passenger installed without any glaring errors. ruby 1.8.6 (2010-0

Re: [Rails] Updating column (migration)

2010-01-26 Thread Simon Macneall
See http://guides.rubyonrails.org/migrations.html, particularly the change_column command Simon On Tue, 26 Jan 2010 17:11:41 +0800, eggie5 wrote: I have a column in a postgres database that keeps track of a date, but for some reason I set it up to use a timestamp, ie. my migration says t.da

Re: [Rails] String to String?

2010-01-13 Thread Simon Macneall
I could be misreading, but I thought it was a simple question of how to change double quotes to single quotes. try var = '"this"' var.gsub!('"',"'") Cheers Simon On Wed, 13 Jan 2010 16:14:47 +0800, srinivasan sakthivel wrote: u can try this @re = "this".gsub("this","'this'") puts @re T

Re: [Rails] invalid pointer in libxml xmlFreeNodeList

2009-12-09 Thread Simon Macneall
On Tue, 08 Dec 2009 16:45:40 +0800, Kristian Hellquist wrote: >> We are running libxml-ruby 1.1.3 and 2.6.32.dfsg-5ubuntu4.2 of libxml2, >> running on Ubuntu 9.04. >> >> Does anyone have any suggestions on how to proceed with fixing the >> issue? > > Test with another xml-lib? REXML or Nokogi

[Rails] invalid pointer in libxml xmlFreeNodeList

2009-12-07 Thread Simon Macneall
Hi, Not sure if there is a better place to post this. The libxml-ruby mailing list doesn't have much activity. We are getting occasional errors on our production box, that I can't duplicate in testing. It's not even reproducible on the production box with the same inputs, but I've managed to

[Rails] Re: Rails Server's case sense dilemma

2009-08-23 Thread Simon Macneall
Hi, Let me guess, you are using windows? That's the only reason that RUBY SCRIPT/SERVER would actually work, as on any other OS, it would force you to use ruby script/server to start the server. That said, the -P isn't a valid option, so the script is ignoring it and starting the server on

[Rails] Re: Noob learning DRY

2009-08-22 Thread Simon Macneall
Hi, Have a look at partials. That's where you can call the same snippet of render code from several views. Also, best practice seems to indicate you should put the find in the controller, not in the view. Cheers Simon On Sun, 23 Aug 2009 04:10:45 +0800, service.sig...@gmail.com wrote: >

[Rails] Re: Efficient way to prune a table

2009-08-14 Thread Simon Macneall
Hi, SearchResults is the model that we are cleaning up, so we do the following on login SearchResults.delete_all(['updated_at < ?', 1.week.ago]) Cheers Simon On Fri, 14 Aug 2009 20:15:20 +0800, RVince wrote: > > Simon, Is there a way to do it all in one sql statement? May I ask how > you i

[Rails] Re: Efficient way to prune a table

2009-08-14 Thread Simon Macneall
We have a similar problem, and the two options we saw were: 1) cron job that ran either rails or sql command to prune the table 2) a function that runs when something else happens (like login/logout) We ended up choosing 2, just because it was easier to implement (didn't have to play around wit

[Rails] Re: xml-containing models

2009-08-09 Thread Simon Macneall
gher doing it your > way, but I'm fine with that. > > > On 9 aug, 13:24, "Simon Macneall" wrote: >> Hi, >> >> I'd be inclined to do something with an index type table, that mapped >> important bits of the XML into the DB. Maybe with machine

[Rails] Re: xml-containing models

2009-08-09 Thread Simon Macneall
Hi, I'd be inclined to do something with an index type table, that mapped important bits of the XML into the DB. Maybe with machine_id, attribute_type, attribute_name, attribute_value as the columns. It can be a bit more work to keep it up, but you get the full flexibility of XML, but can

[Rails] Re: how to set smpt server for our rails applicaion

2009-07-28 Thread Simon Macneall
What's the rational behind using initializers instead of environment files? We are (and have been for some time) setting the smtp options in the environment files with great success. Cheers Simon On Tue, 28 Jul 2009 23:40:15 +0800, Rick wrote: > > Don't use environment.rb, use instead: "conf

[Rails] Re: Curious why copying an array element by element fails when using strip!

2009-07-08 Thread Simon Macneall
Hi, Did you read the documentation on strip and strip!? (http://ruby-doc.org/core/classes/String.html#M000820) strip! modifies the existing string (returning itself if a modification occurred and nil if nothing was done), while strip does the modification and returns a new string. Simon

[Rails] Re: find(:all) problem

2009-07-07 Thread Simon Macneall
Hi You don't do find on an instance of the model, you do it on the model itself. So your find should be Stuff.find( :all, :select => 'mp1') Simon On Wed, 08 Jul 2009 07:00:47 +0800, Mark Preston wrote: > > Newbie question, trying to get data from a mysql database. I can write > to it fin

[Rails] Re: How to dynamically load plugin files on every request?

2009-07-03 Thread Simon Macneall
Your welcome. The differences probably mean we are using different versions of Rails. Cheers Simon On Sat, 04 Jul 2009 14:52:28 +0800, Vikrant wrote: > > Thanks Simon Macneall, > It worked!! > I hope you mean ActiveSupport::Dependencies by Dependencies otherwise >

[Rails] Re: How to dynamically load plugin files on every request?

2009-07-03 Thread Simon Macneall
I have this in my development.rb file, which I set up when I was making some changes to a thirdparty plugin and got sick of the constant restarting. # this forces the Ezgraphix plugin to be reloaded each time - to facilitate 'fixing' and updating it Dependencies.explicitly_unloadable_const

[Rails] Re: Trouble with email delivery

2009-07-03 Thread Simon Macneall
then I guess the next step is to make sure the credentials you are using are ok On Sat, 04 Jul 2009 09:11:30 +0800, Marco Oliveira wrote: > > Hey Simon, > > Yes, I am able to telnet into shawmail.wp.shawcable.ca 25. > > Thanks for the reply, > Marco > > &g

[Rails] Re: Trouble with email delivery

2009-07-03 Thread Simon Macneall
sounds like the mail server isn't set up to accept connections from your server. Check that you can telnet to port 25 of that server to see if it accepts the connection. Simon On Sat, 04 Jul 2009 01:32:28 +0800, Marco Oliveira wrote: > > Over the past few days I've been going crazy tryin

[Rails] Re: i need some help

2009-07-02 Thread Simon Macneall
Hi, That sounds like you haven't set up your database.yml file correctly. Simon On Thu, 02 Jul 2009 20:11:33 +0800, Rajendra Bayana wrote: > > > hi, i am new to the ruby on rails. > > i am trying to create one web application using ror, i created directory > structure and started webrick se

[Rails] Re: First application: Alternatives to creating a database?

2009-06-27 Thread Simon Macneall
Hi, I assume you have set up your database.yml file correctly, then just create the db manually using using the webpanel, and then run rake db:migrate to create all your tables. Simon On Sat, 27 Jun 2009 06:55:54 +0800, wolfbyt...@gmail.com wrote: > > Hi, > > I've done a bit of web deve

[Rails] Re: Regular expression

2009-06-19 Thread Simon Macneall
Perhaps it's best if you try, and then if you fail ask the question? Otherwise you will be asking on the list everytime you need a regular expression I recomment the following http://www.addedbytes.com/cheat-sheets/regular-expressions-cheat-sheet/ Simon On Sat, 20 Jun 2009 13:44:15 +0800, N

[Rails] Re: Session Reset when clicking back button of the browser

2009-06-18 Thread Simon Macneall
I think that that will be a function of the browser. Some browsers reload the page on back button, so just display content from the cache. Either way, unless you can specify to not cache the page, and the browser honours it, not much you can do to stop it happening. Simon On Fri, 19 Jun 2

[Rails] Re: Date.new.to_time.to_i

2009-06-18 Thread Simon Macneall
If you look at the classes returned, Date.new.to_time returns a DateTime, while Date.today.to_time returns a Time Date.new.to_time.class --> DateTime Date.today.to_time.class --> Time Not sure why that is the case, but obviously DateTime doesn't have a to_i method. Simon On Fri, 19 Jun 200

[Rails] Re: how can i get attribute values from xml using libxml

2009-06-08 Thread Simon Macneall
try researching xpaths, particularly how to or 2 xpaths together. On Mon, 08 Jun 2009 22:03:14 +0800, lecielbleu wrote: > > Thanks a lot Simon , it worked , > can we double this filter method like category="601" and brand="15" at > the same time > --~--~-~--~~~---~-

[Rails] Re: how can i get attribute values from xml using libxml

2009-06-08 Thread Simon Macneall
try doc.find('//Root/s...@category="601"]') On Mon, 08 Jun 2009 21:09:06 +0800, lecielbleu wrote: > > Hi , > i have xml document like this > > Brand="001"> > > then i have to use Category attribute but reader class couldnt > recognize attributes > > when i use these codes

[Rails] Re: I need a lot of advice here - let's start from the beginning

2009-05-28 Thread Simon Macneall
try sudo gem install On Fri, 29 May 2009 11:59:03 +0800, J. D. wrote: > > Hi everyone - thanks for all of the input. Here's an update: > > I did install VirtualBox on my Vista and got the latest ubuntu and > created a virtual drive etc., installing it. > > I'm now up and running with Vista a

[Rails] Re: I need a lot of advice here - let's start from the beginning

2009-05-28 Thread Simon Macneall
On Fri, 29 May 2009 11:20:23 +0800, Marnen Laibow-Koser wrote: > > I should have been clearer. Based on the research I've done about > NetBeans, and on how the program is marketed, it seems that its > Eclipse-like nature and what I understand to be a heavy JRuby > implementation are not reall

[Rails] Re: I need a lot of advice here - let's start from the beginning

2009-05-28 Thread Simon Macneall
Heh? you are disagreeing rather strongly based on a program that you have never used? We use netbeans as our Rails dev environment, and have had no problems at all. On Fri, 29 May 2009 11:05:46 +0800, Marnen Laibow-Koser wrote: > > Jim wrote: > [...] >> I recommend using Netbeans as a d

[Rails] Re: I need a lot of advice here - let's start from the beginning

2009-05-28 Thread Simon Macneall
The other thing to consider (I had a quick look at VirtualBox the other day) is that the VMWare vms are portable across OSs, while VirtualBox's aren't So, if you are using vmware, your dev vm on vista will run on vmware player on Linux, but this doesn't apply for VirtualBox. However, they h

[Rails] Re: I need a lot of advice here - let's start from the beginning

2009-05-28 Thread Simon Macneall
We are using VMWare on Vista, and having no problems. I have had a bit of a look at VirtualBox, but the tools for vmware seem a bit more complete. On the 'harder to set up' issue, there are appliances that you can download that are pretty much a complete ubuntu vm. Just download and away y

[Rails] pdf-writer and new page sizes

2009-05-14 Thread Simon Macneall
Hi all, We are creating pdf documents using pdf-writer, and are pretty happy with the results. The only sticking point is we need to create pages of different sizes. Does anyone have any idea of whether this can be done using pdf-writer? And if not, does anyone have a suggestion of the best

[Rails] Re: Multiple file upload w/Rails 2.x

2009-05-14 Thread Simon Macneall
It does a normal post, just like any other js that is generated from rails, so it's just a matter of reading the params on the other end. On Fri, 15 May 2009 07:43:27 +0800, wejrow...@gmail.com wrote: > > That looks like a start. But what about integrating it with Rails? > That's my problem,

[Rails] Re: Multiple file upload w/Rails 2.x

2009-05-14 Thread Simon Macneall
we are using swfupload, which works pretty well. It allows you to show progress of each upload etc. We switched to this because the customer wanted a multi-select file dialog. before that, we had rolled our own js solution, which allowed the user to pick one file at a time, but upload them all

[Rails] Re: Can a moderator check my message?

2009-05-01 Thread Simon Macneall
You won't see your message. gmail has this lovely thing where it sees your message in the outbox, so doesn't show you it when it is received again from the list. caught me out the first time I tried posting :) Simon On Fri, 01 May 2009 07:28:04 +0800, Ahad L. Amdani wrote: > > I posted a

[Rails] Re: updating parent resource whenever child is updated

2009-04-28 Thread Simon Macneall
Because the upduser is the same, it doesn't think that the object has really changed, so doesn't update the timestamps. We had a similar problem where we needed to update the timestamps on the root object of a tree whenever anything in the tree changed. I ended up implementing a touch method o

[Rails] Re: Replace the first word of a string

2009-04-23 Thread Simon Macneall
How about something like words = {} words['word'] = 'newword' words['otherword'] = 'newotherword' outmessage = message splits = message.split(' ') if (words[splits[0]]) splits[0] = words[splits[0]] outmessage = splits.join(' ') end obviously it can be cleaned up a fair bit, but the hash wil

[Rails] Re: Generating Word Doc

2009-04-21 Thread Simon Macneall
Thanks, I ended up with something similar, using html and multipart mime Simon On Tue, 21 Apr 2009 22:58:18 +0800, paron wrote: > > There is an antique technique written up by Sam Neff at > http://coldfusion.sys-con.com/node/41604 for ColdFusion. It works, and > you don't need to run Word on

[Rails] Re: Generating Word Doc

2009-04-21 Thread Simon Macneall
I didn't think about that. I have html working fine now, but will keep this in mind for when the customer (as is almost guaranteed) asks for a more complex document. Cheers Simon On Tue, 21 Apr 2009 22:57:07 +0800, wjl_xyz wrote: > > You can talk directly to the OpenOffice back-end, and have

[Rails] Re: can we decrypt the cipher encrypted using Digest::SHA1.hexdigest

2009-04-21 Thread Simon Macneall
We've got the same thing where I am at the moment. The old .net app has the passwords stored in plain text in the Db. I guess if you get as far as being able to log onto the db, then you have already gotten full access to the system, but still seems wrong. Simon On Wed, 22 Apr 2009 09:25:39 +

[Rails] Re: Generating Word Doc

2009-04-21 Thread Simon Macneall
.com > > On Apr 21, 6:53 am, "Simon Macneall" wrote: >> Hi all, >> >> Does anyone have any suggestions for generating a word doc from a linux >> rails application? We were using html and just naming it .doc, which >> works well until you need to

[Rails] Re: Generating Word Doc

2009-04-21 Thread Simon Macneall
important. Cheers Simon On Tue, 21 Apr 2009 10:03:18 +0800, Steven E wrote: > > I'm working on something similar to this now. I'm writing my own > libraries I will post back when I'm done. Will put it on rubyforge > > Sent from my iPhone > > On Apr 20, 2009, a

[Rails] Re: Generating Word Doc

2009-04-20 Thread Simon Macneall
The only problem with HTML is that I can't find a way to embed the image (that works in Word), as opposed to having it link back to our server (which isn't the desired outcome). On Tue, 21 Apr 2009 13:24:50 +0800, Marnen Laibow-Koser wrote: > > Simon Macneall wrote: >&

[Rails] Re: Generating Word Doc

2009-04-20 Thread Simon Macneall
ile needed to be > editable upon download so Simon's solution is pretty reasonable. > > You might look into RTF. Some google searches seem to say that you > can embed images into that format. > > On Apr 20, 2009, at 8:58 PM, Simon Macneall wrote: > >> >> That&#

[Rails] Re: Generating Word Doc

2009-04-20 Thread Simon Macneall
quick/easy job :) Thanks Simon On Tue, 21 Apr 2009 12:06:53 +0800, Andrew Timberlake wrote: > > On Tue, Apr 21, 2009 at 5:58 AM, Simon Macneall > wrote: >> >> That's a fabulous answer. >> I wouldn't be asking if I could convince my customers that a

[Rails] Re: Generating Word Doc

2009-04-20 Thread Simon Macneall
That's a fabulous answer. I wouldn't be asking if I could convince my customers that a PDF would do. They need to be able to edit the document after it is generated. -1 for helpfulness On Tue, 21 Apr 2009 11:38:01 +0800, Marnen Laibow-Koser wrote: > > Simon Macneall

[Rails] Generating Word Doc

2009-04-20 Thread Simon Macneall
Hi all, Does anyone have any suggestions for generating a word doc from a linux rails application? We were using html and just naming it .doc, which works well until you need to embed images into the document. MHT looks promising but the only libraries aren't free (not a deal breaker, but free

[Rails] Re: conditional count mysql query.

2009-04-05 Thread Simon Macneall
isn't it just User.count(:conditions => {:sex => 'female'}) syntax may be a bit wrong, but you should be able to google to sort it out. Simon On Mon, 06 Apr 2009 07:10:11 +0800, Morgan Morgan wrote: > > so i have a database filled with stats and i need to return a number > from those stats f

[Rails] Re: Rails Query within Query

2009-03-12 Thread Simon Macneall
I think something like the following: book_ids = ids of selected books (as gleened from the controller) chapter_threes = Chapter.find(:all, :include => :book, :conditions => ['book.id in ? and chapter.chapter_number = 3', book_ids]) obviously not tested, but once you fix any syntax errors it sh

[Rails] Re: Rails Query within Query

2009-03-12 Thread Simon Macneall
Wouldn't it be something like the following: suess_chapter_three = Chapter.find(:all, :include=>:book, :conditions => ['books.auther like "suess" and chapters.chapter = 3']) Simon On Fri, 13 Mar 2009 09:24:29 +0900, Avi Ir wrote: > > Hello, > > I am looking for a better way to do the follow

[Rails] Re: parsing an xml file from another website

2009-02-21 Thread Simon Macneall
Just a suggestion though, although the REXML api is really nice to use, I'd start with libxml. The speed difference is large enough to put up with the api being a little less intuitive. just my 2cents Simon On Sun, 22 Feb 2009 08:47:37 +0900, Frederick Cheung wrote: > > > On 21 Feb 2009,

[Rails] Re: Newbie Question : else if

2009-02-07 Thread Simon Macneall
try elsif Simon On Sat, 07 Feb 2009 23:33:37 +0900, akira wrote: > > Hello, i have started using ruby on rails, and searched the web for > this information but found nothing! > My problem is : i have main.html.rb and inside a conditional : > > <% if controller.controller_name == "main" %> > >

[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] Re: posting to rails app from another process - authenticity problems

2009-01-13 Thread Simon Macneall
Hi, Put protect_from_forgery :except => :index at the top of your controller, where :index is your action. Cheers Simon On Tue, 13 Jan 2009 18:28:28 +0900, phil wrote: > > Hi, > I am trying to post some data to our existing Rails application from a > seperate java application. I am running

[Rails] Re: Testing data from a file

2009-01-10 Thread Simon Macneall
On Sun, 11 Jan 2009 04:31:06 +0900, Phlip wrote: > > Simon Macneall wrote: > >> I have some functional tests that require XML input that gets set into >> the >> RAW_POST_DATA. I would like to get the XML for each tests from files (to >> save having lots of XML

[Rails] Testing data from a file

2009-01-08 Thread Simon Macneall
Hi, I have some functional tests that require XML input that gets set into the RAW_POST_DATA. I would like to get the XML for each tests from files (to save having lots of XML in my test.rb. Is there anything in the testing framework to handle this, or should I just load the file manually? Cheer

[Rails] Re: relationships quickie

2009-01-07 Thread Simon Macneall
Yeah, that is the way that the associations work. if a model 'has_one' of something, then the something has the foreign key relationship back. It is described fairly nicely here: http://guides.rails.info/association_basics.html Simon On Wed, 07 Jan 2009 20:13:41 +0900, Dave Smith wrote:

[Rails] Fwd: Loading Hash during testing using Fixtures

2009-01-06 Thread Simon Macneall
--- From: "Simon Macneall" To: "rubyonrails-talk@googlegroups.com" Cc: Subject: Loading Hash during testing using Fixtures Date: Wed, 07 Jan 2009 15:46:57 +0900 Hi all, I am finally starting to use the testing framework that rails provides, however I have come across a

[Rails] Loading Hash during testing using Fixtures

2009-01-06 Thread Simon Macneall
Hi all, I am finally starting to use the testing framework that rails provides, however I have come across a problem that I can't work out. Our model has a serialized hash as one of the members, and I can't work out the syntax in the YML file to populate the hash during testing. Any suggest

[Rails] Re: Condition LIKE with or for autocomplete

2009-01-01 Thread Simon Macneall
Shouldn't it be @inscritos = Inscrito.find(:all, :conditions => ["LOWER(nombre) LIKE ? OR LOWER(apellido) LIKE ?", '%' + params[:familiar]["0"].downcase + '%' ], '%' + params[:familiar]["0"].downcase + '%' ], :order => 'apellido ASC', :limit => 8)

[Rails] Re: Rails app supplying image to a static page?

2008-12-30 Thread Simon Macneall
Hi Mark, I would be inclined to create a controller and have an action on it that serves up a random image. This would make your static URL something like http://photo.website.com/random/pic Create a controller called random, and an action called pic (you can call these anything, or even u

[Rails] Populating associations

2008-12-22 Thread Simon Macneall
Hi all, I have a Message class which has_many Message_Users, Message_User is basically a join table with an attribute, and belongs_to a User. so it kinda looks like the following: Message has_many :message_users MessageUser belong_to :user User - lots of user stuff What I want to do, is o

[Rails] Re: Rails & dbd-odbc error

2008-12-21 Thread Simon Macneall
I followed the following instructions on Linux and it all worked pretty much straight away: http://wiki.rubyonrails.org/rails/pages/HowtoConnectToMicrosoftSQLServerFromRailsOnLinux They also have OS instructions - http://wiki.rubyonrails.com/rails/pages/HowtoConnectToMicrosoftSQLServer Simon

[Rails] Re: Rails & dbd-odbc error

2008-12-21 Thread Simon Macneall
you can get the equivalent on Linux using freeTDS and uniODBC, which is a funish setup On Mon, 22 Dec 2008 06:27:17 +0900, MaurĂ­cio Linhares wrote: > > Isn't ODBC only available on Windows boxes? > > - > MaurĂ­cio Linhares > http://alinhavado.wordpress.com/ (pt-br) | http://blog.codevader.co

[Rails] Re: Processing uploaded XML file

2008-12-19 Thread Simon Macneall
Hi Marc, Yes, the processing will block mongrel, but you should have more than one mongrel (either using Passenger, or straight apache load balancing). The bigger question is can your user wait 30 seconds for the response? There are ways to run the process on a separate thread, but I haven'

[Rails] Re: jQuery Rails Functions

2008-12-12 Thread Simon Macneall
Hey DAZ, No probs. From our code.. $.ajax({ url: "/form_datas/correct/"+formId, so, form_datas is our controller, correct is the action, and formId is the id param passed to the action you may be able to use rails helper methods, I don't know, we just specify the URL

[Rails] Re: MySQL Error inserting blob

2008-12-10 Thread Simon Macneall
I just know that when we had that 'mysql has gone away' error, the mysql logs had something like 'value too large for col' etc... But if that isn't your problem, then I have nothing else to offer :( On Wed, 10 Dec 2008 18:02:32 +0900, Farmer Schlutzenberg <[EMAIL PROTECTED]> wrote: > > Hi S

[Rails] Re: MySQL Error inserting blob

2008-12-10 Thread Simon Macneall
we have had the same problem and it turned out to be the size of the column in mysql whenever we create a blog column we go through and change the type to LONGBLOB using the following in the migration. execute "ALTER TABLE pgcs CHANGE pgc pgc LONGBLOB;" Simon On Wed, 10 Dec 2008 17:04:25 +

[Rails] Re: jQuery Rails Functions

2008-12-08 Thread Simon Macneall
to the > controller and start updating model attributes. I haven't had time to > test your code, but will have a play around. > > Also ... is all the authenticity_token stuff essential/best practice > or are you just using that as an example? > > thanks again, > > DAZ

[Rails] Re: How to update the existing application to new rails version?

2008-12-08 Thread Simon Macneall
Just run rake rails:update in your application folder. I have done it for our app and it was pretty painless. Simon On Mon, 08 Dec 2008 19:05:58 +0900, Prabhakar Karve <[EMAIL PROTECTED]> wrote: > > I have a rails application created with an earlier version of Rails. I > would like to take b

[Rails] Re: jQuery Rails Functions

2008-12-07 Thread Simon Macneall
DAZ, http://docs.jquery.com/Main_Page is pretty good. We use $.post because of some extra stuff we need to do, but $.ajax is probably the best option for you. Something like this should work (warning, written in front of the TV and untested) $("#list").droppable({ accept: ".item", ho

[Rails] Re: jQuery Rails Functions

2008-12-06 Thread Simon Macneall
Hi, You need to call a function in your drop handler that goes out to rails to make the changes. We do the following in some of our jquery handlers: var c = {}; c['authenticity_token'] = encodeURIComponent(window._token); c['user_id'] = <%= current_user.id %>; $.post("<%= url_for(:action => '

[Rails] Re: Authenticity Token change under 2.2.2?

2008-12-03 Thread Simon Macneall
Excellent, works like a charm, thanks for that. Simon On Wed, 03 Dec 2008 17:13:50 +0900, Frederick Cheung <[EMAIL PROTECTED]> wrote: > > > > > Well (I had to look this up since I never use raw XMLHttpRequest) the > parameter to send is the body of the request. When rails gets a text/ > plain

[Rails] Re: Authenticity Token change under 2.2.2?

2008-12-02 Thread Simon Macneall
Hi Fred, No, the authenticity_token isn't getting through at all, and I accept that the code probably should have never worked as it stands. That said, I can't for the life of me figure out how to get the auth token to be submitted correctly using the XMLHttpRequest object. We have the toke

[Rails] Authenticity Token change under 2.2.2?

2008-12-02 Thread Simon Macneall
Hi, We have the following code which sends a request on unload of one of our pages. It was working fine until I upgraded to rails 2.2.2, but now is giving 'ActionController::InvalidAuthenticityToken (ActionController::InvalidAuthenticityToken):' Does anyone know what has changed, and what

[Rails] Re: SMTP Mailer is KILLING me

2008-11-29 Thread Simon Macneall
one dumb question, and this has caught me before, you are restarting after changing settings? On Sat, 29 Nov 2008 17:49:36 +0900, Patrick Leahy <[EMAIL PROTECTED]> wrote: > > Folks, the first person to figure this one out will make my day. Let's > just say I've tried everything for the past

[Rails] Re: Rails Beginner.. NoMethodError

2008-11-27 Thread Simon Macneall
try changing User.get_title to user.get_title you are trying to access a method on the class instead of on the instance. Cheers Simon On Fri, 28 Nov 2008 13:28:23 +0900, Valentino Lun <[EMAIL PROTECTED]> wrote: > > Dear all > > I encounter error when I login my Web application > NoMethodErro

[Rails] Re: Database password encryption

2008-11-26 Thread Simon Macneall
On Thu, 27 Nov 2008 13:51:45 +0900, Hassan Schroeder <[EMAIL PROTECTED]> wrote: >> I don't like either way and I was just hoping that somebody had >> already ran into this and had a better solution. > > The only way around it is to have someone enter the password into > the system at startup, w

[Rails] Re: MySQL

2008-11-23 Thread Simon Macneall
Are you trying to log into the mysql command line tool to do sql queries etc? if so, then it isn't mysqladmin, it is just mysql ie 'mysql -u root -proot' if you are actually trying to do something with mysqladmin, you need to put that command on the command line, ie 'mysqladmin -u root -proo

  1   2   >