[Rails] Re: ROR + React

2019-08-20 Thread Douglas Lovell
Here is an open source project on GitHub that combines React with Rails: https://github.com/wbreeze/socelect It takes a monorepo approach, with the front-end JS code next to the back-end Rails. To integrate, it simply has the JS build (uses Parcel) output the transpiled, bundled javascript

[Rails] Re: When do I need to use build when creating new records

2019-04-01 Thread Douglas Lovell
The `build` method constructs the ORM object without validating or saving. It provides an opportunity to configure attributes before saving, before validating. If you feel good about the `params[:auction]`, have them filtered with `require` and `permit`, and aren't going to groom the record

[Rails] Re: Alternative to Heroku

2018-12-03 Thread Douglas Lovell
For completeness, though I'm not sure I recommend others punish themselves thus: I provision a Linode box using Ansible and deploy to it with Capistrano. S3 bucket for attachments. It's quite cheap but also takes (or took up) a lot of my time. Tried the elastic beanstalk and felt totally

Re: [Rails] Simple (I'm sure) Question about Joins

2012-08-03 Thread Douglas Lovell
Steve: Assuming your many comments to one user relation is set-up properly, ask for cu = comment.user. Then %= cu.username % will work for you. Doug Douglas Lovell www.wbreeze.com On 08/03/2012 03:40 PM, Steve Morrissey wrote: I'm working on a into rails project in parallel with a book

Re: [Rails] Start learning from Ruby or directly from Rails.

2012-07-31 Thread Douglas Lovell
I personally started with Ruby first. I like the books from The Pragmatic Bookshelf. (pragprog.com) Douglas Lovell www.wbreeze.com On 07/31/2012 01:40 PM, Rubyist Rohit wrote: I want to build a small GUI application that makes sense and not just a Hello World application. I tried wxRuby

Re: [Rails] find_or_initialize_by_id block parameter

2012-07-28 Thread Douglas Lovell
The 'do' block only executes if the find_or_initialize_by method creates the record. The find_or_initialize_by method does not execute the 'do' block if the record exists. Feature of Ruby that the 'do' block goes to the method and the method must yield to execute the block. Douglas Lovell

Re: [Rails] expert advice needed on realtime events in ruby on rails application?

2012-07-11 Thread Douglas Lovell
This on-line game of go by Ryan Bates uses a background process to compute moves when playing against the computer. https://github.com/ryanb/govsgo It uses Resque Doug Douglas Lovell www.wbreeze.com On 07/11/2012 05:48 AM, rubybox wrote: In my app I have the need to be able to have