Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Ruby code for simple Search query
@notes = DrupalNode.where(
'type = "note" AND node.status = 1 AND title LIKE ?',
"%" + params[:id] + "%"
)
.joins(:drupal_tag)
.where('term_data.name LIKE ?', 'question:%')
.order('node.nid DESC')
.page(params[:page])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment