app/models/user.rb
# Return viewable notebooks with a specific tag
Return viewable notebooks with a specific tag
Return viewable notebooks with a specific tag
def readable_notebooks_with_tag(tag, page=1)
    readable_notebooks(page)
      .joins('LEFT OUTER JOIN tags ON tags.notebook_id = notebooks.id')
      .where('tags.tag = ?', tag)
  end
def readable_notebooks_with_tag ( tag , page = 1 ) readable_notebooks ( page ) . joins ( 'LEFT OUTER JOIN tags ON tags.notebook_id = notebooks.id' ) . where ( 'tags.tag = ?' , tag ) end
Return viewable notebooks with a specific tag
Return viewable notebooks with a specific tag
tag
page