[Rails] Destroy method link_to show

2012-11-21 Thread Soichi Ishida
Rails 3.1.3 I have User model and Plan model User has the following association has_many :gives, :class_name => "Plan", :foreign_key => :give_id, :dependent => :destroy And a view generates <% @user.gives.each do |give| %> ... <%= link_to 'Delete', {:controller => :plans, :action =>

Re: [Rails] Re: Opinion on a particular use of Initializers

2012-11-21 Thread Jordon Bedwell
On Wed, Nov 21, 2012 at 8:57 PM, Alex Braha Stoll wrote: > Thanks for the answer, Fred. > > When you say lazily loading the data I need you mean waiting for a first > request that uses the data, right? If so, how can I do that in a way that > the data will persist for the next requests (from the s

[Rails] Re: Opinion on a particular use of Initializers

2012-11-21 Thread Alex Braha Stoll
Thanks for the answer, Fred. When you say lazily loading the data I need you mean waiting for a first request that uses the data, right? If so, how can I do that in a way that the data will persist for the next requests (from the same and from other users)? Just storing the data into a class th

Re: [Rails] File sharing site tutorial?

2012-11-21 Thread Walter Lee Davis
On Nov 21, 2012, at 5:55 PM, John Dunlap wrote: > Thanks for the super informative post! I've done the very basics of > rails, and I'm honing my Ruby language skills at the moment (I've heard > it's a bad stereotype, that people learn RoR for before Ruby itself) > > I'm guessing Amazon cloud i

[Rails] Re: Question about Active Record

2012-11-21 Thread Alexandra E Paredes T
Fred thanks for the response, a friend and I did some tests and found some useful info. Altough we're now wondering what would it happen if we decide not to work with ActiveRecord on RoR, what features of the framework we're going to lose? El sábado, 17 de noviembre de 2012 05:02:53 UTC-4:30, F

[Rails] Re: File sharing site tutorial?

2012-11-21 Thread John Dunlap
Thanks for the super informative post! I've done the very basics of rails, and I'm honing my Ruby language skills at the moment (I've heard it's a bad stereotype, that people learn RoR for before Ruby itself) I'm guessing Amazon cloud is good cloud hosting for this sort of thing? -- Posted via

Re: [Rails] File sharing site tutorial?

2012-11-21 Thread Walter Lee Davis
On Nov 21, 2012, at 4:57 PM, John Dunlap wrote: > I've been thinking of doing a RoR application for a file sharing site a > la imgur, but for other kinds of files (Namely 3D modeling stuff.) Is > there a decent tutorial for this sort of app? I've been told that > paperclip for ruby might be a dec

[Rails] Re: Opinion on a particular use of Initializers

2012-11-21 Thread Frederick Cheung
On Wednesday, November 21, 2012 5:57:15 PM UTC, Alex Braha Stoll wrote: > > > Since the profile ids (and other 'constants' stored in the database) can > only change if the sys admin changes their values before the deploy > (editing seeds.rb), I though of using initializers to retrieve reference

[Rails] Opinion on a particular use of Initializers

2012-11-21 Thread Alex Braha Stoll
Hi! In the Rails app I'm developing I have some data stored in the database that acts like constants. For example, I populate a profiles table with all the profile types using seeds.rb. To avoid hardcoding the profile ids in my code, everytime I needed to do an operation involving a profile typ

[Rails] [JOBS] RoR Developer at SF Google-Backed Start Up

2012-11-21 Thread Nathan Visconti
The Climate Corporation is a Google Ventures funded big data startup with a mission to help people adapt to climate change. We make sense of huge amounts of complicated data and run simulations to determine the risk of adverse weather, which influences 25% of GDP. We are l

[Rails] I Dont like it but i have to do it

2012-11-21 Thread Moises Zaragoza
I need to open access to a no username and password to my application. What i did was i added a *userkey* field on my users model that can be past via a get or post method from another site. that will then find the correct user and log them in as if they had put in there user name and passw

[Rails] Re: Pessimistic locking locks the entire table?

2012-11-21 Thread Frederick Cheung
On Wednesday, November 21, 2012 7:24:05 PM UTC, jmcguckin wrote: > > What happens when a 2nd process tries to write to a record/table that is > locked? Does it stall until the lock is released or > does it throw an exception? > > It will block until the lock is released. If the lock is never rel

[Rails] File sharing site tutorial?

2012-11-21 Thread John Dunlap
I've been thinking of doing a RoR application for a file sharing site a la imgur, but for other kinds of files (Namely 3D modeling stuff.) Is there a decent tutorial for this sort of app? I've been told that paperclip for ruby might be a decent place to start, but I could see a lot of landmines in

[Rails] JOBS IN GERMANY

2012-11-21 Thread Rocío C.
Hello, I´m looking for Ruby and Rails developer for interesting job in Germany. You can see the position in www.es.exrein.com If you are intereste, please, send me your english cv to r...@exrein.com Skills: -2-3 years of experience in Ror, -Fluent english -Work permit for Germany (Blue Card) if

[Rails] Re: Pessimistic locking locks the entire table?

2012-11-21 Thread jmcguckin
What happens when a 2nd process tries to write to a record/table that is locked? Does it stall until the lock is released or does it throw an exception? On Friday, April 6, 2012 3:18:37 AM UTC-7, Frederick Cheung wrote: > > > > On Apr 4, 12:47 am, PierreW wrote: > > I don't know if using pessi

Re: [Rails] is there a better DRY code writing for this scope ?

2012-11-21 Thread Dave Aronson
On Wed, Nov 21, 2012 at 8:33 AM, Erwin wrote: > I wrote this scope in my Subdomain model : > > scope :in_account, lambda { |account_id| > if account_id == "*" > where("account_id >= ?", 0) > else > where(account_id: account_id) > end > } > > where account_id == '*' th

[Rails] Re: clue about deleting empty directories in a file structure ?

2012-11-21 Thread Erwin
[SOLVED] found a better module extending FileUtils .. it works module MyExtensions module FileUtils # Gracefully delete dirs that are empty (or contain empty children). def rmdir_empty(*dirs) dirs.each do |dir| begin ndel = Dir.glob("#{dir}/**/", File::FNM_DOTMAT

[Rails] clue about deleting empty directories in a file structure ?

2012-11-21 Thread Erwin
I have been playing around w Dir and FileUtils, and I can delete the stuff I want to get rid off , but then I get some empty folders is there any way to remove ( recursively.. ) all empty folders ? I found a piece of code dated 2007 ... is there anything new around ? thanks for feedback -- Yo

Re: [Rails] right click or Context Menu in ruby without javascript

2012-11-21 Thread Walter Lee Davis
On Nov 21, 2012, at 12:21 AM, nikhil rn wrote: > I finally decided to take up the right click using HTML5. Thank you all. > I referred David Walsh website for the > same(http://davidwalsh.name/html5-context-menu). Is there a way to > remove the system generated right click options? You could

Re: [Rails] Nested Attributes in Rails 3

2012-11-21 Thread Colin Law
On 21 November 2012 12:28, Jinet wrote: > > hi.. > im going to start learning ruby..now dont know even a single thing about > ruby,,can anyone please suggest how to start learning..? > thank you.. What has that got to do with the subject line (Nested Attributes in Rails 3) and why have you posted

[Rails] Re: ice_cube 0.3.1

2012-11-21 Thread Tomasz Żewłakow
First of all, your plugin is just great! Although: How am I able to rule opening hours of a restaurant within single Schedule? Mon-Fri 8-16 is quite easy but schedule = Schedule.new(Time.parse(Date.yesterday.to_s + ' 8:00'), :duration => 60*60*8) (...) schedule.add_recurrence_rule R

Re: [Rails] Nested Attributes in Rails 3

2012-11-21 Thread Jinet
hi.. im going to start learning ruby..now dont know even a single thing about ruby,,can anyone please suggest how to start learning..? thank you.. jinet On 21 November 2012 11:59, Unni wrote: > Cheers ! > > > On Wed, Nov 21, 2012 at 11:55 AM, avinash behera < > aavinash.beh...@gmail.com> wrote:

Re: [Rails] Are Rail's database tools really helpful?

2012-11-21 Thread Scott Ribe
On Nov 21, 2012, at 3:56 AM, Denis BEURIVE wrote: > Instead of writing a simple SQL request, you write a complicated set of > methods' invocations (with options...). 1) the methods are not that complicate 2) if you wish, you can just write SQL instead and get objects back -- Scott Ribe scott_r

[Rails] Re: Are Rail's database tools really helpful?

2012-11-21 Thread Frederick Cheung
On Wednesday, November 21, 2012 10:56:58 AM UTC, Ruby-Forum.com User wrote: > > > Instead of writing a simple SQL request, you write a complicated set of > methods' invocations (with options...). > > The resulting code is not easy to read. You think : I should write an > easy to read SQL request

Re: [Rails] is there a better DRY code writing for this scope ?

2012-11-21 Thread Erwin
Great ! Thanks Jim Le mercredi 21 novembre 2012 15:04:57 UTC+1, jim a écrit : > > > > > On Wed, Nov 21, 2012 at 9:33 PM, Erwin >wrote: > >> I wrote this scope in my Subdomain model : >> >> scope :in_account, lambda { |account_id| >> if account_id == "*" >> where("account_id >= ?", 0)

[Rails] Sunspot Solr specialized search

2012-11-21 Thread Keith Raymond
Hello all, I have a question that I've searched for a bit but can't really find anything. I might not be searching on the right things. I have Sunspot/solr working great and now I want to start using it to speed up Backbone.js queries. I have it currently working with straight Rails. ===

Re: [Rails] is there a better DRY code writing for this scope ?

2012-11-21 Thread Jim Ruther Nill
On Wed, Nov 21, 2012 at 9:33 PM, Erwin wrote: > I wrote this scope in my Subdomain model : > > scope :in_account, lambda { |account_id| > if account_id == "*" > where("account_id >= ?", 0) > else > where(account_id: account_id) > end > } > > where account_id == '*' th

[Rails] is there a better DRY code writing for this scope ?

2012-11-21 Thread Erwin
I wrote this scope in my Subdomain model : scope :in_account, lambda { |account_id| if account_id == "*" where("account_id >= ?", 0) else where(account_id: account_id) end } where account_id == '*' then all subdomain instances are selected when account_id is given ,

[Rails] Are Rail's database tools really helpful?

2012-11-21 Thread Denis BEURIVE
Hello, I am looking at Rails for two days. I already use ZF (Zend Framework), Codeigniter and ELGG. My big concern is the ORM's. In a real world application, you don't just play with one table at a time. You have to write long SQL requests, with several tables : Using ZF (Zend Framework) ou Code

[Rails] What to use //= require_tree or js,css incude tag in application.erb ?

2012-11-21 Thread Fahim Patel
Hi , We are using reqiure_tree in our application.js and application.css. As per i know require_tree include all js and css in application.js and application.css . We include application file of both .js and .css in our application.erb. Q . We include both .js and .css application file in ap

[Rails] Re: Share Cookies in rails 3.1.3

2012-11-21 Thread kingston.s
i got the error.Its working now. Its my mistake. On Tuesday, November 20, 2012 5:38:45 PM UTC+5:30, kingston.s wrote: > > Hi all, > > > i am using Rails 3.1.3 and ruby 1.9.3.i need to set the cookies for > multiple domain, > Example: *test.abc.com* and *example.abc.com* are the two >

[Rails] Re: Rails 3.2 Extending String Core Classe as per Rails doc

2012-11-21 Thread Erwin
Thanks Fred for this clear feedback ... I did it (added require 'yoodle.rb' in my initializers/configuration.rb) and it works ... :-))) Le mercredi 21 novembre 2012 00:18:43 UTC+1, Frederick Cheung a écrit : > > > On Tuesday, November 20, 2012 4:46:56 PM UTC, Erwin wrote: >> >> >> and I have