carlos-roque.com
My Work – Carlos Roque
http://www.carlos-roque.com/my-work
Code Hints, Examples and more. KPL – Kodak Professional Language. Nelson Wells' Blog. Theme: Accelerate by ThemeGrill.
carlos-roque.com
Ruby on Rails – Carlos Roque
http://www.carlos-roque.com/category/ruby-on-rails
Code Hints, Examples and more. TIL some awesome ActiveRecord behaviors in Rails. February 10, 2015. February 10, 2015. So I started using rails about 3 months ago and it has been awesome. ActiveRecords was my first experience using ORM. I wish I had started using this a long time ago since using associations makes life so easy. For example this is what I learned today. Lets take the following Models:. Managers = @account.contacts.where(:title = manager). You can get all the contacts for that account.
carlos-roque.com
TIL some awesome ActiveRecord behaviors in Rails – Carlos Roque
http://www.carlos-roque.com/2015/02/10/til-some-awesome-activerecord-behaviors-in-rails
Code Hints, Examples and more. TIL some awesome ActiveRecord behaviors in Rails. February 10, 2015. February 10, 2015. So I started using rails about 3 months ago and it has been awesome. ActiveRecords was my first experience using ORM. I wish I had started using this a long time ago since using associations makes life so easy. For example this is what I learned today. Lets take the following Models:. Managers = @account.contacts.where(:title = manager). You can get all the contacts for that account.
carlos-roque.com
Getting tinymce-rails to play nice in Rails 4 and Turbolinks – Carlos Roque
http://www.carlos-roque.com/2015/02/19/getting-tinymce-rails-to-play-nice-in-rails-4-and-turbolinks
Code Hints, Examples and more. Getting tinymce-rails to play nice in Rails 4 and Turbolinks. February 19, 2015. February 19, 2015. I am using the plugin on a project and I kept having problems loading the editor on for the second time. The problems materialized in two different ways. On first page view the editor worked as intended, on second page viewed the editor did not show at all. So I narrowed down the problem to two issues. And happily this made the editor appear on every request! So to summarize,...
carlos-roque.com
Adding and Removing Children From a Form in Rails 4 – Carlos Roque
http://www.carlos-roque.com/2014/11/18/adding-and-removing-children-from-a-form-in-rails-4
Code Hints, Examples and more. Adding and Removing Children From a Form in Rails 4. November 18, 2014. November 18, 2014. This is a topic that seems to get asked a lot and answered in so many different ways. I haven’t really found an answer that I considered full and easy to follow. Also, most answers were give for rails 3. So I decided I would share my implementation. I have made this project available in GitHub. Look at the last commit to see all the changes made to the empty project. Adding the Javasc...
carlos-roque.com
About – Carlos Roque
http://www.carlos-roque.com/about
Code Hints, Examples and more. KPL – Kodak Professional Language. Nelson Wells' Blog. Theme: Accelerate by ThemeGrill.
carlos-roque.com
Meeting Your Blog Readers – Carlos Roque
http://www.carlos-roque.com/2014/08/05/meeting-your-blog-readers
Code Hints, Examples and more. Meeting Your Blog Readers. August 5, 2014. August 5, 2014. I know this is a small blog and the audience is very limited. I don’t really go to programing conferences so my chances of meeting people that might read my blog are very slim, or so I thought. Roll back to July 2014. I was attending the Kodak DP2 Users conference, a 3 day long event full of learning, food, drinking, food, games and did I mention food? 2 thoughts on “ Meeting Your Blog Readers. Hey, that was me̷...
carlos-roque.com
Using Devise to create a new Copmany that a User belongs_to in Rails 4 – Carlos Roque
http://www.carlos-roque.com/2014/11/06/using-devise-to-create-a-copmany-that-a-user-belongs_to-in-rails-4
Code Hints, Examples and more. Using Devise to create a new Copmany that a User belongs to in Rails 4. November 6, 2014. August 15, 2016. It turns out it was very simple so here it is. I will leave setting up rails and generating the Devise views for you to google. You need to already have a User and Company Model. I will assume you have done all that or you can just clone my example from Github Example. First on our config/routes.rb we add this. Now for Our Views. The new registration app/views/devise/r...
carlos-roque.com
Ruby – Carlos Roque
http://www.carlos-roque.com/category/ruby
Code Hints, Examples and more. Calculate the Size of Base64.strict encode64 in Ruby. April 14, 2016. April 15, 2016. I was in need to calculate the size of the output of Base64.strict encode64. I wanted to get this value to determine if the file was too big to send to an API endpoint. If the file was too big I didn’t want to spend time processing and trying to send the data. So I put together this method using a bunch of answers from stack overflow and the article in wikipedia for base64. December 3, 2015.