Skip to content

Helper Method

funao edited this page Dec 7, 2016 · 6 revisions

View Helper Method

notee_content(post)

notee_content(post) converts post in markdown notation nice to html and returns it.

notee_comment_box(post_id)

notee_comment_box(post_id) render "notee/partials/comment_box.html.erb"

notee_meta(meta = Notee.blog_meta)

notee_meta(meta = Notee.blog_meta) sets and returns meta information feeling nice.

notee_title

notee_title return CMS(blog) title

notee_description

notee_description return CMS(blog) description

Helper Method

notee(search_txt)

notee(search_txt) method return the published post.

search_txt:

  • post_id
  • post_slug

notees

notee(search_txt) method return all published post.

category_notees(search_txt)

category_notees(search_txt) method return posts that has category_id correspond to serach_txt.

search_txt:

  • category_slug
  • category_name

archive_notees(year, month)

archive_notees(year, month) method return posts correspond to year or year and month.

writer_notees(name_or_id)

writer_notees(name_or_id) method return writer.posts correspond to name or id.

notee_categories

notee_categories returns hash that all published categories and the number of articles in the category

return hash format

{notee.category.name, notee.count}

notee_archives

notee_archives returns hash that month and the number of articles in the month

return hash format

{notee.time, notee.count}

notee_writers

notee_writers returns all writers

notee_comments(post_id)

notee_comments(post_id) return comments on that article of post_id

notee_set_meta_by_post(post)

notee_set_meta_by_post(post) sets the information of post to hash nicely and returns it