Re: [Rails] Coalesce (ruby method, not a SQL question)

2015-03-04 Thread Scott Ribe
On Mar 4, 2015, at 8:32 AM, Daniel Loureiro loureir...@gmail.com wrote: Hi everyone, it's a silly question (and I'm kind of ashamed to ask it), but I frequently must do things like that: a.present? ? a : b a.presence || b

[Rails] Coalesce (ruby method, not a SQL question)

2015-03-04 Thread Daniel Loureiro
Hi everyone, it's a silly question (and I'm kind of ashamed to ask it), but I frequently must do things like that: a.present? ? a : b or a real world example: params[:user][:name].present? ? params[:user][:name] : default name I think these are perfect cases to use a coalesce method.

Re: [Rails] Coalesce (ruby method, not a SQL question)

2015-03-04 Thread Daniel Loureiro
Hi everyone, it's a silly question (and I'm kind of ashamed to ask it), but I frequently must do things like that: a.present? ? a : b a.presence || b Whoa! Thank you Scott, you save my day. -- Daniel Loureiro -- You received this message because you are subscribed to the

Re: [Rails] model association

2015-03-04 Thread Vineeth B S
I would say, Colin has given a sound advise. Do take a look at Activerecord Associations http://guides.rubyonrails.org/association_basics.html and other railsguides pages. They are really great! Vineeth On Tue, Mar 3, 2015 at 2:57 AM, Colin Law clan...@gmail.com wrote: On 2 March 2015 at

[Rails] Rails PDF is not accepting CSS

2015-03-04 Thread Jeffrey Bonson
Hi, I am not able to see the css inside the PDF. the generated pdf will display in black n white. Am getting images inside the pdf file. Please see the below code that i have implemented. If anyone finds a solution please help! Am using OS :Ubuntu Rails: 4.1.8 Ruby :2.1.5p273 Webserver:

RE: [Rails] Live fuzzy search from database table

2015-03-04 Thread Julio Papel
Hi Jaga, take a llok to this tutorial https://www.youtube.com/watch?v=QJ8IRlRcFhI from Mike Hibbert in his Ruby on Rails - Build your own ecommerce Engine tutorial. He show how you can create and use a rails engine, I believe you will understand how to search your catalog with it.