[Rails] Re: Re: a hands-on tutoring needed

2012-07-07 Thread sehrguey o.
Javier Quarite wrote in post #1067748: > You can send an empty array or whatever you want, or maybe you can > handle > that in the controller Walter Davis wrote: >You could kink the form to only submit if there is a value in the search >field, you would do that with JavaScript. Something like th

Re: [Rails] Re: Re: Problem processing text file after uploading

2012-07-07 Thread Hassan Schroeder
On Sat, Jul 7, 2012 at 3:55 PM, David M. wrote: >>> When store_docfile is called before after_save, it never even gets to >>> the first line containing the logger.info "we are now in store_docfile" >>> message. In your new example file, it's no surprise you're not seeing anything -- you're never

[Rails] Re: Re: Problem processing text file after uploading

2012-07-07 Thread David M.
Hassan Schroeder wrote in post #1067836: > On Sat, Jul 7, 2012 at 1:24 PM, David M. wrote: > >> When store_docfile is called before after_save, it never even gets to >> the first line containing the logger.info "we are now in store_docfile" >> message. > > I don't see any obvious problems in your

Re: [Rails] Re: Problem processing text file after uploading

2012-07-07 Thread Hassan Schroeder
On Sat, Jul 7, 2012 at 1:24 PM, David M. wrote: > When store_docfile is called before after_save, it never even gets to > the first line containing the logger.info "we are now in store_docfile" > message. I don't see any obvious problems in your original file. If not with after_save, how are yo

[Rails] Opening Up a Service Through an API

2012-07-07 Thread tekram
I wanted to get advice on opening up a Rails application to allow an external service to make REST calls to my service. Currently, REST calls are only made securely through the out of the box Rails security. However, I would like to open all of those to external users via an API. For example,

[Rails] Re: Problem processing text file after uploading

2012-07-07 Thread David M.
I know you guys seem to be sticking to the RTFM hardline, but it seems as though debugging in the model has very few options without importing a bunch of gems. Even on the page recommended there are 35 mentions of controller, and only 4 mentions of model. I installed debugger 'gem install debu

Re: [Rails] Re: Active Record - Object Wrapping a Table Row

2012-07-07 Thread Colin Law
On 7 July 2012 19:26, Doug Jolley wrote: >> As it states the result is effectively an array of Order objects. So >> to get the name of the first object one uses pos[0].name. > > I THINK you are confirming my suspicion. Clearly, the first object > (which corresponds to the first table row) is pos

[Rails] Re: Active Record - Object Wrapping a Table Row

2012-07-07 Thread Doug Jolley
> As it states the result is effectively an array of Order objects. So > to get the name of the first object one uses pos[0].name. I THINK you are confirming my suspicion. Clearly, the first object (which corresponds to the first table row) is pos[0]. From that I would deduce that pos[0].name i

Re: [Rails] Re: Re: Re: Problem processing text file after uploading

2012-07-07 Thread Hassan Schroeder
On Sat, Jul 7, 2012 at 10:12 AM, David M. wrote: > When outside of after_save, a database entry gets created, but file_data > doesn't get saved to the hard drive. OK, why not? As Colin suggested, study the debugging guide (or just put logging statements in the code to see what's happening at ea

Re: [Rails] Re: Re: Re: Problem processing text file after uploading

2012-07-07 Thread Colin Law
On 7 July 2012 18:12, David M. wrote: > Hassan Schroeder wrote in post #1067817: >> On Sat, Jul 7, 2012 at 10:02 AM, David M. wrote: >> > The file handling code I have doesn't seem to function unless it happens > after_save, I'm not sure why that is. Well, since it's a "learning

[Rails] Re: Re: Re: Problem processing text file after uploading

2012-07-07 Thread David M.
Hassan Schroeder wrote in post #1067817: > On Sat, Jul 7, 2012 at 10:02 AM, David M. wrote: > The file handling code I have doesn't seem to function unless it happens after_save, I'm not sure why that is. >>> >>> Well, since it's a "learning project" maybe that would be a good place >>>

Re: [Rails] Re: Re: Problem processing text file after uploading

2012-07-07 Thread Colin Law
On 7 July 2012 18:02, David M. wrote: > Hassan Schroeder wrote in post #1067812: >> On Sat, Jul 7, 2012 at 9:21 AM, David M. wrote: >> >>> The file handling code I have doesn't seem to function unless it happens >>> after_save, I'm not sure why that is. >> >> Well, since it's a "learning project"

Re: [Rails] Re: Re: Problem processing text file after uploading

2012-07-07 Thread Hassan Schroeder
On Sat, Jul 7, 2012 at 10:02 AM, David M. wrote: >>> The file handling code I have doesn't seem to function unless it happens >>> after_save, I'm not sure why that is. >> >> Well, since it's a "learning project" maybe that would be a good place >> to start :-) > > Any hints? Start by defining ex

Re: [Rails] Active Record - Object Wrapping a Table Row

2012-07-07 Thread Colin Law
On 7 July 2012 17:29, Doug Jolley wrote: > I'm following through an example provided by DHH in his book, "Agile Web > Development with Rails". This example deals with a database with an > "orders" table that has column names, "name", "email", "address" and > "pay_type". > > The Order class is cre

[Rails] Re: Re: Problem processing text file after uploading

2012-07-07 Thread David M.
Hassan Schroeder wrote in post #1067812: > On Sat, Jul 7, 2012 at 9:21 AM, David M. wrote: > >> The file handling code I have doesn't seem to function unless it happens >> after_save, I'm not sure why that is. > > Well, since it's a "learning project" maybe that would be a good place > to start :-

Re: [Rails] Re: Problem processing text file after uploading

2012-07-07 Thread Colin Law
On 7 July 2012 17:21, David M. wrote: > Hassan Schroeder wrote in post #1067807: >> On Sat, Jul 7, 2012 at 8:11 AM, David M. wrote: >> >>> Currently the model handles those files, saves some metadata (the >>> extention and orig filename) then saves the file to the hard drive. Next >>> it converts

Re: [Rails] Re: Problem processing text file after uploading

2012-07-07 Thread Hassan Schroeder
On Sat, Jul 7, 2012 at 9:21 AM, David M. wrote: > The file handling code I have doesn't seem to function unless it happens > after_save, I'm not sure why that is. Well, since it's a "learning project" maybe that would be a good place to start :-) Alternatively, you might consider pushing the do

[Rails] Active Record - Object Wrapping a Table Row

2012-07-07 Thread Doug Jolley
I'm following through an example provided by DHH in his book, "Agile Web Development with Rails". This example deals with a database with an "orders" table that has column names, "name", "email", "address" and "pay_type". The Order class is created thusly: class Order < ActiveRecord::Base end L

[Rails] Re: Problem processing text file after uploading

2012-07-07 Thread David M.
Hassan Schroeder wrote in post #1067807: > On Sat, Jul 7, 2012 at 8:11 AM, David M. wrote: > >> Currently the model handles those files, saves some metadata (the >> extention and orig filename) then saves the file to the hard drive. Next >> it converts the doc and docx files to plain text and save

Re: [Rails] Problem processing text file after uploading

2012-07-07 Thread Hassan Schroeder
On Sat, Jul 7, 2012 at 8:11 AM, David M. wrote: > Currently the model handles those files, saves some metadata (the > extention and orig filename) then saves the file to the hard drive. Next > it converts the doc and docx files to plain text and saves the output to > a txt file. > > My problem is

[Rails] Re: Problem processing text file after uploading

2012-07-07 Thread David M.
But...paperclip is OLD and unmaintained, and this is also a learning project. So is there some (best practices) way to do the following things without having to make another pass over my doc_file or using paperclip: 1. upload .doc and store metadata 2. convert to plain text and write .txt to ha

Re: [Rails] Problem processing text file after uploading

2012-07-07 Thread Walter Lee Davis
On Jul 7, 2012, at 11:11 AM, David M. wrote: > I've got a web-app currently partially working. The user uploads a .txt, > .docx or .doc file to the server. > > Currently the model handles those files, saves some metadata (the > extention and orig filename) then saves the file to the hard drive.

[Rails] Problem processing text file after uploading

2012-07-07 Thread David M.
I've got a web-app currently partially working. The user uploads a .txt, .docx or .doc file to the server. Currently the model handles those files, saves some metadata (the extention and orig filename) then saves the file to the hard drive. Next it converts the doc and docx files to plain text and

[Rails] Re: table link

2012-07-07 Thread Sebastian H.
and how would it look like? i don't know how to use all instance variables (e.g. :given_user) with the onclick! Please give an example -- 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 p