[Rails] Re: NoMethodError: undefined method `expenses'

2009-01-28 Thread Eric
UMQ: Use More Quotes! :vendor => "vendor1", :amount => "75.00" On Jan 28, 9:22 pm, Andrew Reid wrote: > Hi, > I am trying to figure out why I am receiving the following error.  I am > following an Apple Developers Rail Application tutorial. > > >> event.expenses.create(:vendor => vendor1, :amou

[Rails] Re: Back button works even after logout - How to prevent?

2009-01-28 Thread Ar Chron
You can add a before_filter to your controllers to ensure that the user is logged in. I use restful authentication (that provides the login_required method), and I let anyone see the index listing of a table, or a show of any individual record, but create, update, new, delete, etc, are all loc

[Rails] Back button works even after logout - How to prevent?

2009-01-28 Thread Tony Puthenveettil
Hi all, In my web application, after logging out, if Back button of the browser is clicked, it takes to the previous logged in pages and allows all operations without logging in. The layout, however, doesn't change, but the yield pages. Please help me prevent that back button operation after logo

[Rails] NoMethodError: undefined method `expenses'

2009-01-28 Thread Andrew Reid
Hi, I am trying to figure out why I am receiving the following error. I am following an Apple Developers Rail Application tutorial. >> event.expenses.create(:vendor => vendor1, :amount =>75.00) NameError: undefined local variable or method `vendor1' for # from (irb):2 Here is what I have for

[Rails] Re: Best practices for develop a web service (server+client)

2009-01-28 Thread Jay Mcgratgh
remotely related ... Can Rails on Ruby work with an established sqlite3 (or mySQL) database? the tutorials I have read so far build the sqlite3 tables with the $ "ruby script/generate model ... " command. I guess what I am trying to figure out is if the Ruby Rails platform will be a wise inve

[Rails] Re: Any one help

2009-01-28 Thread Shankar Ganesh
Is it possible to get using cycle method?? Rob Zolkos wrote: > Hi Shankar, > > Have a look at the api documentation for the cycle method > > http://api.rubyonrails.org/classes/ActionView/Helpers/TextHelper.html#M001551 > > Thanks, > Rob -- Posted via http://www.ruby-forum.com/. --~--~-

[Rails] Removing an association from a derived class

2009-01-28 Thread pankaj
I am using single table inheritance. class User < ActiveRecord::Base has_many :abc end class Student < User end The student class should not inherit the has_many :abc relationship. How can we override it? Is there a way to remove an association in the derived class? Pankaj --~--~-

[Rails] Re: Any one help

2009-01-28 Thread robokos
Hi Shankar, Have a look at the api documentation for the cycle method http://api.rubyonrails.org/classes/ActionView/Helpers/TextHelper.html#M001551 Thanks, Rob Shankar Ganesh wrote: > --- > id | what | when | color | to

[Rails] Re: javascript function needs rails variable

2009-01-28 Thread Rabia Akhtar
it starts working Cheers Rabia Akhtar On Wed, Jan 28, 2009 at 8:41 PM, jemminger wrote: > > This will only work if that script block is in an .erb template. > > On Jan 28, 1:02 am, Rabia wrote: > > > > > > document.getElementById('h').checked=true; > > show_coords(<%= @pic_comments.to_

[Rails] Any one help

2009-01-28 Thread Shankar Ganesh
--- id | what | when | color | to | description | --- 1 | test |01/01/2009 | red|04/01/2009 | hi this is test |

[Rails] Re: Rails runtime

2009-01-28 Thread Mark Reginald James
Camille Roux wrote: > I've a question about the Rails runtime. > I'd like to know which part of Rails is executed (and put in memory) at > each request? at each server launch? > In other words, is Rails like PHP (the whole code is "executed" at each > request)? On on start-up in production mode

[Rails] Re: Plugin Module Help

2009-01-28 Thread Mark Reginald James
Nate Leavitt wrote: > Is the thread specific for the request in rails? Meaning.. the > before_filter will be run on each rails action/request therefore is a > new thread created in rails for that process? Jeez.. I hope I'm > explaining it properly :) Yes, each thread only carries one request

[Rails] CGI Sessions

2009-01-28 Thread doug
I have several Rails sites running that use sessions and they all post cookies properly and otherwise work flawlessly. I now have need of implementing a more raw approach to sessions using CGI::Sessions. The Pickaxe book gives an example of how to do it (which I will append to this message) afte

[Rails] Re: Mysql::Error: Duplicate entry

2009-01-28 Thread Frederick Cheung
On 28 Jan 2009, at 21:14, Rt Rr wrote: > > > hello , I am designing a project for a news website and I am new to > ROR > I am facing a problem with the add news function > > this is the error > > Mysql::Error: Duplicate entry '' for key 1: INSERT INTO `articals` > (`body`, `title`, `date`, `t

[Rails] Net:HTTP.post returns an Array

2009-01-28 Thread David Law
I was wondering if anyone has run into this problem. I post using a Net::HTTP object and instead of getting Net::HTTPResponse object, the server returns an Array causing an error since an we typically attempt to read the body of the Net::HTTPResponse object. Does anyone know why this is occurrin

[Rails] Re: :active_record_store + :table_name_with_underscore session issues

2009-01-28 Thread Frederick Cheung
On 29 Jan 2009, at 00:26, Tim wrote: >> >> When I look in the sessions table the hashed data in the `data` field >> looks normal, but there are integers being stored in the session_id >> field, not the 32 character hashes I would expect. And every page >> reload creates a new session, the integ

[Rails] Re: :active_record_store + :table_name_with_underscore session issues

2009-01-28 Thread Tim
You may want to browse: http://api.rubyonrails.org/classes/ActionController/RequestForgeryProtection/ClassMethods.html and http://api.rubyonrails.org/classes/ActionController/RequestForgeryProtection.html Good luck! Tim On Jan 28, 1:24 pm, Greg Donald wrote: > Today I created a new Rails 2.2

[Rails] Re: format.html and redirect_to

2009-01-28 Thread Frederick Cheung
On 28 Jan 2009, at 23:42, Ricky wrote: > >> It might not be a browser. Eg with a create action you would >> typically >> redirect browsers to the show action, but the XML api probably >> wouldn't do that. > > Thanks for responding Fred. > > So are you saying that sometimes a redirect is not ac

[Rails] Re: Can I "fake" an object model on top of a flat ActiveReco

2009-01-28 Thread Duane Morin
You know, that might be exactly it. I knew I'd heard it somewhere before :). Thanks! Sorry for the interruption. D Duane Morin wrote: > This might be a painfully bad idea, but it's gotten me curious. I have > a generic object Node, which has a name attribute. Say for example that > one of t

[Rails] Re: Can I "fake" an object model on top of a flat ActiveRecord?

2009-01-28 Thread Tim
I'm not completely clear on what your trying to accomplish but it sounds like STI may be what your looking for? http://wiki.rubyonrails.org/rails/pages/singletableinheritance Good luck! Tim On Jan 28, 3:40 pm, Duane Morin wrote: > This might be a painfully bad idea, but it's gotten me curious.

[Rails] Re: format.html and redirect_to

2009-01-28 Thread Ricky
> It might not be a browser. Eg with a create action you would typically   > redirect browsers to the show action, but the XML api probably   > wouldn't do that. Thanks for responding Fred. So are you saying that sometimes a redirect is not actually a redirect in the 302 sense of the word? Rathe

[Rails] Can I "fake" an object model on top of a flat ActiveRecord?

2009-01-28 Thread Duane Morin
This might be a painfully bad idea, but it's gotten me curious. I have a generic object Node, which has a name attribute. Say for example that one of the names is "Widget". What I'm wondering is, is there a way to manipulate ActiveRecord to make a class named Widget, that behaves exactly like

[Rails] Re: xml_http_request : action not found?

2009-01-28 Thread itsastickup
Ok, so the solution seems to be to forget paths and do the test like this : xml_http_request :delete,'destroy',{:id=>1,:person_id=>1} --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To po

[Rails] Re: Best practices for develop a web service (server+client)?

2009-01-28 Thread Xdmx Xdmx
Freddy Andersen wrote: > What about activeResource ? You mean activeresource for the rest approach ? for that sure, but you'd always have the client who request a given url and get some xml to parse... right? Which is the better format to give the client between xml and json ? And how to parse

[Rails] Re: Database names

2009-01-28 Thread Luke Pearce
James Bond wrote: > If I generate a model by: "./script generate model user" it make a table > "users". > But if I want that table is "user" not "users" what I can do? Think this is what you're looking for: http://wiki.rubyonrails.org/rails/pages/howtouselegacyschemas Cheers Luke -- Posted via

[Rails] Re: Database names

2009-01-28 Thread Robert Walker
James Bond wrote: > If I generate a model by: "./script generate model user" it make a table > "users". > But if I want that table is "user" not "users" what I can do? You can override the default table name in your migration file after running the generator. However, if I had anything to say a

[Rails] Re: Best find for the job...

2009-01-28 Thread Robert Walker
Neal L wrote: > What I'm trying to do is find the total charges during the year for > each customer by account. In other words, a function like: I'm guessing that the most efficient way to accomplish this (that is without doing some data caching), would be to let the database handle it. If yo

[Rails] Re: xml_http_request : action not found?

2009-01-28 Thread itsastickup
> > I have this in a functional test: > > > xml_http_request :delete, person_movie_path(1,1) > > > and the error I get says the action cannot be found, as if the > > ':delete'  method is not being translated to the appropriate destroy > > action. It works fine as an Ajax call from the browser. > >

[Rails] :active_record_store + :table_name_with_underscore session issues

2009-01-28 Thread Greg Donald
Today I created a new Rails 2.2.2 project. I'm using Oracle and activerecord-oracle-adapter (1.0.0.9250). I'm using ActiveRecord::Base.primary_key_prefix_type = :table_name_with_underscore, which is a spec for the project that I cannot change. I ran `rake db:sessions:create` and it created a ne

[Rails] Re: xml_http_request : action not found?

2009-01-28 Thread Jeffrey L. Taylor
Quoting itsastickup : > > > I have this in a functional test: > > xml_http_request :delete, person_movie_path(1,1) > > and the error I get says the action cannot be found, as if the > ':delete' method is not being translated to the appropriate destroy > action. It works fine as an Ajax call f

[Rails] Mysql::Error: Duplicate entry

2009-01-28 Thread Rt Rr
hello , I am designing a project for a news website and I am new to ROR I am facing a problem with the add news function this is the error Mysql::Error: Duplicate entry '' for key 1: INSERT INTO `articals` (`body`, `title`, `date`, `tag`) VALUES('nnn', 'hhh', '2008-03-02', '') - t

[Rails] Re: Restful routes and Rails Console

2009-01-28 Thread Bharat Ruparel
Thank you Steve. This is precisely what I needed. Thomas, I appreciate your time as well. It is just that I learn better by typing "things" in the Rails Console in bits and pieces and see what happens. It is this interactive nature of Ruby and Rails which I like very much. Reminds me of the

[Rails] Database names

2009-01-28 Thread James Bond
If I generate a model by: "./script generate model user" it make a table "users". But if I want that table is "user" not "users" what I can do? -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are subscribed to

[Rails] JOBS-Ruby on Rails Developer position OPEN in Atlanta!!

2009-01-28 Thread mcf...@gmail.com
Client in Atlanta is looking for a Mid-Level Ruby on Rails Developer. Open to relocation. Check out job the description below. If you are interested please email resumes to m...@thecentricsgroup.com and I will contact you shortly after. Description: Client is looking for a Ruby on Rails Develo

[Rails] Re: Creating an object from a pp string?

2009-01-28 Thread Yanni Mac
Yanni Mac wrote: > Here is the full implementation in case anyone is interested. > > Server 2 needs to get a widget object from server 1 > > > Server 1 code > -- > WidgetController > def show_widget_yaml > @widget = Widget.find(params[:id]) > render :layout => false > end > >

[Rails] xml_http_request : action not found?

2009-01-28 Thread itsastickup
I have this in a functional test: xml_http_request :delete, person_movie_path(1,1) and the error I get says the action cannot be found, as if the ':delete' method is not being translated to the appropriate destroy action. It works fine as an Ajax call from the browser. What am I doing wrong?

[Rails] Re: Plugin Module Help

2009-01-28 Thread Nate Leavitt
Mark Reginald James wrote: > Yes. Is the thread specific for the request in rails? Meaning.. the before_filter will be run on each rails action/request therefore is a new thread created in rails for that process? Jeez.. I hope I'm explaining it properly :) Also, since that before filter is

[Rails] Re: Creating an object from a pp string?

2009-01-28 Thread Yanni Mac
Here is the full implementation in case anyone is interested. Server 2 needs to get a widget object from server 1 Server 1 code -- WidgetController def show_widget_yaml @widget = Widget.find(params[:id]) render :layout => false end show_widget_yaml.rhtml <%=YAML.dump(@product

[Rails] Re: User Interface / View Looks

2009-01-28 Thread sullivan.t
:) I know, I know. I guess what I've done is hit that "wall" where I know my visual creativity sucks, and I need that polishing to refresh that old- fashioned "inner" desire to code my own on the side. Can't do it like I used to, 15 years ago. By the time I get home, I'm exhausted from coding a

[Rails] Re: Best practices for develop a web service (server+client)?

2009-01-28 Thread Nate Leavitt
Xdmx Xdmx wrote: > Hi, i've two applications (APP1 and APP2) and i want that APP2 is able > to get data from APP1. I think that a simple rest web service is the way > to go. Do you have some good examples/tutorials? I've googled but i find > only old examples with the deprecated action web service

[Rails] Re: Restful routes and Rails Console

2009-01-28 Thread s.ross
Hi-- On Jan 28, 2009, at 10:44 AM, Thomas R. Koll wrote: > > Hi, > > On Jan 28, 5:10 pm, Bharat Ruparel wrote: > >> I am trying to see what comments_url resolves to in the Rails >> Console, >> but do not know how. > > There's a good reason for this: You don't use/need urls in your > console. > T

[Rails] Re: Plugin Module Help

2009-01-28 Thread Nate Leavitt
Mark Reginald James wrote: > Nate Leavitt wrote: > >> Is that multi-thread safe for the newer versions of rails? > > Yes. > > -- > Rails Wheels - Find Plugins, List & Sell Plugins - > http://railswheels.com Ok thanks. I guess my next question is more in regards to threads, but if I have mul

[Rails] Re: Creating an object from a pp string?

2009-01-28 Thread Yanni Mac
Philip Hallstrom wrote: >> Right now I am just creating a pipe-delimited string of the object >> attributes. Then the other server takes that string, splits it on | >> and >> populates a new object. Really I am just wondering if there is a one >> liner from a library where I can do this. JSON

[Rails] Re: Creating an object from a pp string?

2009-01-28 Thread Philip Hallstrom
>> >> If you really want to go that route you might look at converting it >> to >> YAML... but I'd also suggest looking at JSON, XML, XML-RPC, REST, >> active resource, etc... >> >> -philip > > Thanks for the quick reply! > > Right now I am just creating a pipe-delimited string of the object > a

[Rails] Re: Creating an object from a pp string?

2009-01-28 Thread Yanni Mac
Philip Hallstrom wrote: > > If you really want to go that route you might look at converting it to > YAML... but I'd also suggest looking at JSON, XML, XML-RPC, REST, > active resource, etc... > > -philip Thanks for the quick reply! Right now I am just creating a pipe-delimited string of the

[Rails] Re: Multi table inheritance problem with has_one relationship

2009-01-28 Thread Rémi Gagnon
Thanks Tom for the suggestion. I did not know this. But the bads new is that does the same issue. It looks like the superclass name is cached in the association then even if I do a reload or (true) and becomes, it fetch the data from Product instead of ProductVT Rémi Thomas r. Koll wrote:

[Rails] Re: Creating an object from a pp string?

2009-01-28 Thread Philip Hallstrom
> When I use pp on an object in rails, it prints out a nice string > representation of the object. I am trying to pass objects from one > server to another and I am wondering if I can just pass this string > and > create an object on the other server. Any libraries/functions out > there > th

[Rails] Creating an object from a pp string?

2009-01-28 Thread Yanni Mac
When I use pp on an object in rails, it prints out a nice string representation of the object. I am trying to pass objects from one server to another and I am wondering if I can just pass this string and create an object on the other server. Any libraries/functions out there that can do this? O

[Rails] Re: Best practices for develop a web service (server+client)?

2009-01-28 Thread Freddy Andersen
What about activeResource ? On Jan 28, 11:02 am, Xdmx Xdmx wrote: > Hi, i've two applications (APP1 and APP2) and i want that APP2 is able > to get data from APP1. I think that a simple rest web service is the way > to go. Do you have some good examples/tutorials? I've googled but i find > only

[Rails] Re: Calculate Page views efficiently

2009-01-28 Thread deepu
sullivan, thanks for the reply. But the very act of inserting into any table means i cannot use page caching which will be aserious performance penalty to pay. i will explore the logs option though. thanks Cheers, Deepu. On Jan 28, 11:15 pm, "sullivan.t" wrote: > Maybe with a d

[Rails] Re: Restful routes and Rails Console

2009-01-28 Thread Thomas R. Koll
Hi, On Jan 28, 5:10 pm, Bharat Ruparel wrote: > I am trying to see what comments_url resolves to in the Rails Console, > but do not know how. There's a good reason for this: You don't use/need urls in your console. The best way is to write tests for your routes, this will also give you the most

[Rails] Re: Multi table inheritance problem with has_one relationship

2009-01-28 Thread Thomas R. Koll
Hi, On Jan 27, 7:46 pm, Rémi Gagnon wrote: > TransactionProduct.find(:first).product.relaod  (reload the product > instance instead of ProductVT) > > Even if I see in the console that is a ProductVT it reloads Product.  I > checked in development.log and in performs the query on Product. > > An

[Rails] Best practices for develop a web service (server+client)?

2009-01-28 Thread Xdmx Xdmx
Hi, i've two applications (APP1 and APP2) and i want that APP2 is able to get data from APP1. I think that a simple rest web service is the way to go. Do you have some good examples/tutorials? I've googled but i find only old examples with the deprecated action web service. From the client, who ge

[Rails] Re: User Interface / View Looks

2009-01-28 Thread Robby Russell
On Wed, Jan 28, 2009 at 10:13 AM, sullivan.t wrote: > > What are people doing these days for the "user interface" side of > applications? I'm in the process of writing something, using a lot of > CSS (good) but I keep getting the feel that this application ("rts") > would be better shown to the

[Rails] Re: save value of text_field in the view

2009-01-28 Thread Maite Piedra
Hello list I have the same problem yet I dont catch value of text_field in the same erb.html file. any idea??? thanks again. -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Grou

[Rails] Re: Calculate Page views efficiently

2009-01-28 Thread sullivan.t
Maybe with a distinct insert into a history table? thread_views (thread_id int, view_count) outside of the before_filter... somewhere else? Or parsing of the logs? On Jan 28, 1:03 pm, deepu wrote: > Hi, >      I am coding forum software in rails. In forum software how many > times a thread is

[Rails] User Interface / View Looks

2009-01-28 Thread sullivan.t
What are people doing these days for the "user interface" side of applications? I'm in the process of writing something, using a lot of CSS (good) but I keep getting the feel that this application ("rts") would be better shown to the world in a flash format on the view end. Thoughts? Adobe AIR?

[Rails] Calculate Page views efficiently

2009-01-28 Thread deepu
Hi, I am coding forum software in rails. In forum software how many times a thread is viewed is an important metric .one way of doing this is creating a before_filter which logs in a view everytime a page is requested. actually just because i need to run this before_filter i can't do page ca

[Rails] Re: Change Database Name

2009-01-28 Thread Dan Weaver
Matt Harrison wrote: > > You could copy the database to the new name, and then change > database.yml. > > Then you can delete the original database without any downtime. > > HTH > > Matt Good suggestion, thank you. -- Posted via http://www.ruby-forum.com/. --~--~-~--~~-

[Rails] Re: Change Database Name

2009-01-28 Thread Matt Harrison
Dan Weaver wrote: > Hi, > > I'd like to change the name of the database for an app I have in > production (the current name is too ambiguous). As I see it I will need > to change the database.yml file and the database name in mysql. Is there > anything else? A better way? Suggestions? > > I want

[Rails] Re: How long do you take for each Development Cycle

2009-01-28 Thread Ar Chron
2 Developers * 3-4 Days * 40-50 Bugs < Happiness... Feel free to alter the first, second and/or third terms until the equation balances. It sounds like you have the correct processes in place, you just need some scope management. With the idea that "less is more", fewer bugs attempted shoul

[Rails] Change Database Name

2009-01-28 Thread Dan Weaver
Hi, I'd like to change the name of the database for an app I have in production (the current name is too ambiguous). As I see it I will need to change the database.yml file and the database name in mysql. Is there anything else? A better way? Suggestions? I want to be on the cautious side, for o

[Rails] Re: Redirecting root to mongrel prefix

2009-01-28 Thread jemminger
On Jan 28, 11:50 am, Freddy Andersen wrote: > I think you are missing a piece of the puzzle, Apache and > mod_proxy... > Yes, this is running behind Apache. We have a Java app that runs at http://java.ourdomain.com/foo We have Apache proxy forwarding http://java.ourdomain.com/bar to http:

[Rails] Re: Rails runtime

2009-01-28 Thread Frederick Cheung
On 28 Jan 2009, at 16:36, Camille Roux wrote: > > Hi, > > I've a question about the Rails runtime. > I'd like to know which part of Rails is executed (and put in memory) > at > each request? at each server launch? > In other words, is Rails like PHP (the whole code is "executed" at > each >

[Rails] Re: How to add fields dynamically?

2009-01-28 Thread Aa Sh
Phlip, Peter, and Bharat, Thank you for advises and your time! -- 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 emai

[Rails] Re: Redirecting root to mongrel prefix

2009-01-28 Thread Freddy Andersen
I think you are missing a piece of the puzzle, Apache and mod_proxy... You would never run multiple app roots unless you had multiple apps and or a php app on / and a rails app on /app1... If you want multiple apps running on your dev env just start them with -p 3001 -p 3002 ... ? much easier...

[Rails] Rails runtime

2009-01-28 Thread Camille Roux
Hi, I've a question about the Rails runtime. I'd like to know which part of Rails is executed (and put in memory) at each request? at each server launch? In other words, is Rails like PHP (the whole code is "executed" at each request)? Thanx Camille Roux -- Posted via http://www.ruby-forum.com/

[Rails] Re: Restful named member routs is not decoded correctly

2009-01-28 Thread Rob Biedenharn
On Jan 28, 2009, at 9:45 AM, Hans wrote: > I define my own member action in the root file as > map.resources :helps You don't need the first one, the second (with the :member option) does what you need. > > map.resources :helps, :member => {:display => :put} > > The tables listed by rake ro

[Rails] Re: How to add fields dynamically?

2009-01-28 Thread Bharat Ruparel
You will need Javascript for this sort of thing as Ryan Bates points out in his screen casts. There are many ways to do it, e.g., RJS templates or unobstrusive Javascript. Next in your create action, you will have to loop through the newly added rows to the database. It sounds simple, but it

[Rails] Re: ajax search feature works in FF but not IE

2009-01-28 Thread Pardee, Roy
Fantastic! That did the trick. Thanks! -Original Message- From: rubyonrails-talk@googlegroups.com [mailto:rubyonrails-t...@googlegroups.com] On Behalf Of Mark Reginald James Sent: Tuesday, January 27, 2009 6:07 PM To: rubyonrails-talk@googlegroups.com Subject: [Rails] Re: ajax search

[Rails] Restful routes and Rails Console

2009-01-28 Thread Bharat Ruparel
The following is a snippet of the routes.rb file: map.resources :blogs do |blog| blog.resources :posts do |post| post.resources :comments end end The index action in the CommentsController shows: redirect_to comments_url I am trying to see what comments_url resolves to in

[Rails] Re: active_scaffold + i18n

2009-01-28 Thread Peter De Berdt
On 28 Jan 2009, at 16:11, natematias wrote: > Simple Localization apparently has support for Active Scaffold > translation. > http://simple-localization.arkanis.de/ > > I do not however know what the the implications of recent I18n changes > in Rails have been to either Simple Localization or Act

[Rails] Re: progress bar

2009-01-28 Thread Anubhaw Prakash
Piyush with Rails wrote: > Have you tried Mongrel upload progress bar plugin. find the link > below. > > http://mongrel.rubyforge.org/wiki/UploadProgress > > There is a caution with this: it needs Apache Web Server. it will not > work for Nginx. > > Thanks, > Piyush. > > On Jan 26, 1:08 pm, An

[Rails] Re: how to delete temp files

2009-01-28 Thread jemminger
http://www.ruby-doc.org/core-1.8.6/classes/FileUtils.html#M004365 --~--~-~--~~~---~--~~ 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 T

[Rails] Re: javascript function needs rails variable

2009-01-28 Thread jemminger
This will only work if that script block is in an .erb template. On Jan 28, 1:02 am, Rabia wrote: > > >     document.getElementById('h').checked=true; >     show_coords(<%= @pic_comments.to_json %>,"main",'<%=$domain%>/ > users/update_picture_div',<%= @picture.id %>) > >   > I have implement th

[Rails] Re: Best find for the job...

2009-01-28 Thread jemminger
In my opinion, the best way is the first way that works. If that method proves to be too inefficient, then optimize afterwards. On Jan 28, 10:03 am, Neal L wrote: > Hi all, > > I'm trying to find the most effective way to generate an aggregation > report.  The models involved are: > > Customer

[Rails] Re: active_scaffold + i18n

2009-01-28 Thread natematias
Philippe, Simple Localization apparently has support for Active Scaffold translation. http://simple-localization.arkanis.de/ I do not however know what the the implications of recent I18n changes in Rails have been to either Simple Localization or Active Scaffold. --J. Nathan Matias www.natemat

[Rails] Redirecting root to mongrel prefix

2009-01-28 Thread jemminger
Mongrel can be started with a prefix e.g. mongrel_rails start -p 3000 --prefix /foobar So that all of the app's URLs are prefixed, e.g. http://localhost:3000/foobar http://localhost:3000/foobar/posts http://localhost:3000/foobar/posts/1 The problem is that if you hit just the root ( ht

[Rails] Re: How to add fields dynamically?

2009-01-28 Thread Aa Sh
Peter De Berdt wrote: > On 28 Jan 2009, at 00:13, Aa Sh wrote: > >> I would like have a simple interface for users to add data into >> database. How to add new textareas in form, until user want it and >> submit all of them at once? > > http://railscasts.com/episodes/73-complex-forms-part-1 > ht

[Rails] How does facebook’s Share a link feature work?

2009-01-28 Thread Ahmed Sobhi
I wanted to implement that feature in a Rails application I'm buidling. A user posts a url, and voila, he gets a better representation for that url. I already dealt with a similar feature before where the requirement was to replace a given url with the page's title and favicon. Facebook go beyon

[Rails] Re: site content blocks

2009-01-28 Thread Jean-Marc (M2i3.com)
How about creating a model (and a table) called contact information You're code will be a lot cleaner and meaningfull. usually compagnies have multiple contacts they like to make visible, having a model for such purpose should provide good starting point and allow for expension (like one bus

[Rails] Best find for the job...

2009-01-28 Thread Neal L
Hi all, I'm trying to find the most effective way to generate an aggregation report. The models involved are: Customer --(has_many)--> Charges Charges --(have_one)-->Account What I'm trying to do is find the total charges during the year for each customer by account. In other words, a funct

[Rails] Restful named member routs is not decoded correctly

2009-01-28 Thread Hans
I define my own member action in the root file as map.resources :helps map.resources :helps, :member => {:display => :put} The tables listed by rake routs displays the pathes and helpers as display_help PUT/helps/:id/display {:controller=>"helps", :action=>"display"} for

[Rails] Re: Override or delete the layouts that are generated by scaffold generated code?

2009-01-28 Thread Ar Chron
Are you pointing your scaffolded controllers at the application layout? class ScaffoldedController < ApplicationController layout "mylayout.html.erb" blah blah blah end -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message

[Rails] How long do you take for each Development Cycle

2009-01-28 Thread Arthur Chan
Hi guys, I don't know if this question is proper to post here. But I think it is related to every developer, so I post. I am using RoR for developments more than a year. We are using Bugzilla. We do unit, funcitonal and watir tests. We usually schedule to do around 40-50 bugs for each developme

[Rails] Re: format.html and redirect_to

2009-01-28 Thread Frederick Cheung
On 28 Jan 2009, at 10:30, Ricky wrote: > > I was wondering what the purpose of wrapping a redirect_to in a > format.html block is. I get why you'd want to do this with a render, > but if you're redirecting the browser to another URL, what's the > point? As I understand it, when redirect_to is

[Rails] Re: Submit buttons with rollover images

2009-01-28 Thread Txarli San
Michael Slater wrote: > The image_submit_button helper makes it easy enough to use images as > submit buttons, but they don't have any rollover effects. I've seen > various JS approaches to make this work, but I'm wondering if there's > a preferred Rails way to do this. > > Has anyone seen a repl

[Rails] How to give onchange for select_year rails helper....

2009-01-28 Thread rails and rails only
<%=select_year(Date.today,:include_blank=>true, :start_year => Date.today.strftime("%Y").to_i, :end_year => 1999)%> i am using rhis helper... now i want to give onchange here Please help me to solve this thanks in advance JK -- Posted via http://www.ruby-forum.com/. --~--~---

[Rails] Re: Apply style in collection_select ?????

2009-01-28 Thread Frederick Cheung
On 28 Jan 2009, at 07:34, Dharmdip Rathod wrote: > > Thanks a lot , > but it is not working here actually your suggested code is breaking my > java script and style problem is still there , but never mind . > Actually > here this issue is looking some critical because i can not see html > gene

[Rails] format.html and redirect_to

2009-01-28 Thread Ricky
I was wondering what the purpose of wrapping a redirect_to in a format.html block is. I get why you'd want to do this with a render, but if you're redirecting the browser to another URL, what's the point? As I understand it, when redirect_to is called, Rails sends a 302 back to the browser, so I'm

[Rails] Override or delete the layouts that are generated by scaffold generated code?

2009-01-28 Thread Marksu
Is it possible to ‘override’ or remove the layouts that are generated by scaffold generated code? I have a application.html.erb layout that works perfectly with my CSS/ DIV based navigation and all I want to do is create some CRUD pages for a couple of database tables. But I want them to live in

[Rails] site content blocks

2009-01-28 Thread torp
newbie question: what is the best way in rails to make content managed data that isn't iterated? eg. on a 'contact us' page i have an business address field that the client needs to be able to update, and there are many other fields on the site that need to be content managed should i create

[Rails] Re: how to create a permanent record in table

2009-01-28 Thread Adam Akhtar
Thanks everyone for your input. Yes I did only want to protect one of the records so ill give your (roberts) method a shot! thank you very much -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are subscribed t

[Rails] X_send_file download 1byte file instade of original size

2009-01-28 Thread Dharmdip Rathod
i m using x_send_file pluggins and download file then only 1byte file is downloaded. in Controller x_send_file("#{RAILS_ROOT}/public#{params[:file]}") if you have idea for this problem so give me a solution -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~

[Rails] Re: RubyOnRails with MS SQL - Connectivity Error

2009-01-28 Thread Luke Pearce
> I have also installed the gem dbi-0.4.0 Tony, I would stick with the older version of ADO one of the 2.x series I'm not sure it'll work with the new dbi. Cheers Luke -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message b