{"action":"created","issue":{"url":"https://api.github.com/repos/ga-wdi-exercises/project1/issues/242","repository_url":"https://api.github.com/repos/ga-wdi-exercises/project1","labels_url":"https://api.github.com/repos/ga-wdi-exercises/project1/issues/242/labels{/name}","comments_url":"https://api.github.com/repos/ga-wdi-exercises/project1/issues/242/comments","events_url":"https://api.github.com/repos/ga-wdi-exercises/project1/issues/242/events","html_url":"https://github.com/ga-wdi-exercises/project1/issues/242","id":142777216,"number":242,"title":"issue with ____","user":{"login":"kairajohnson","id":1395912,"avatar_url":"https://avatars.githubusercontent.com/u/1395912?v=3","gravatar_id":"","url":"https://api.github.com/users/kairajohnson","html_url":"https://github.com/kairajohnson","followers_url":"https://api.github.com/users/kairajohnson/followers","following_url":"https://api.github.com/users/kairajohnson/following{/other_user}","gists_url":"https://api.github.com/users/kairajohnson/gists{/gist_id}","starred_url":"https://api.github.com/users/kairajohnson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kairajohnson/subscriptions","organizations_url":"https://api.github.com/users/kairajohnson/orgs","repos_url":"https://api.github.com/users/kairajohnson/repos","events_url":"https://api.github.com/users/kairajohnson/events{/privacy}","received_events_url":"https://api.github.com/users/kairajohnson/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-03-22T20:54:02Z","updated_at":"2016-03-22T21:05:43Z","closed_at":null,"body":"I tried to define a method I will be using in my view in my model. I expected the method to be recognized since its in my posts.rb file and view  but it showed as undefined instead.\r\n\r\nMy repo link is  https://github.com/kairajohnson/live-unapologeticallyand \r\nmy question is about lines 45 in my index.html.erb file for posts and posts.rb file in my model.\r\n\r\n\r\n\r\nmy model\r\n```\r\nclass Post < ActiveRecord::Base\r\n\r\n  def recent_posts\r\n    image_tag post.featured_image\r\n    post.title\r\n    post.content\r\n  end\r\nend\r\n```\r\n\r\nmy posts controller\r\n```\r\nclass PostsController < ApplicationController\r\n\r\n def index\r\n   @posts = Post.all\r\n   params.permit(:featured_image)\r\n end\r\n\r\n def new\r\n   @post = Post.new\r\n end\r\n\r\n def create\r\n   @post = Post.create!(post_params)\r\n   @post.save\r\n   redirect_to @post\r\n end\r\n\r\n def show\r\n   @post = Post.find(params[:id])\r\n end\r\n\r\n def edit\r\n   @post = Post.find(params[:id])\r\n end\r\n\r\n def update\r\n   @post = Post.find(params[:id])\r\n   @post.update(post_params)\r\n   redirect_to @post\r\n end\r\n\r\n def destroy\r\n   @post = Post.find(params[:id])\r\n   @post.destroy\r\n   redirect_to posts_path(@post)\r\n end\r\n\r\n private\r\n def post_params\r\n   params.require(:post). permit(:title, :content, :featured_image, :featured_video, :category)\r\n end\r\nend\r\n\r\n```\r\n\r\nmy html\r\n\r\n```\r\n<!DOCTYPE html>\r\n<html>\r\n  <head>\r\n    <meta charset=\"utf-8\">\r\n    <title>Unapologetic</title>\r\n  </head>\r\n  <body>\r\n\r\n    <div id = \"featured-post\" style=\"text-align: center; padding-top: 35px;\">\r\n      <%= image_tag Post.last.featured_image, style:'max-width: 700px; height: auto'%>\r\n      <h1 class=\"featured_title\" style=\"padding-top: 15px; color: pink;\"><%= Post.last.title %></h1>\r\n      <div class=\"featured_content\" style=\"padding: 0px 100px; width: 800px; margin: 0 auto;\"><%= Post.last.content %></div>\r\n    </div>\r\n\r\n\r\n<div id=\"section-title\" style=\"padding-top: 100px;\">\r\n<h1 class=\"section-title-left\"style=\"width: 70%;\"> In Her Closet </h1>\r\n<h1 class=\"section-title-right\"style=\"width: 30%;\"> Recent Posts </h1>\r\n</div>\r\n\r\n<div id=\"main\">\r\n\r\n  <table id=\"grid\" style=\"width: 66.66%; float: left;\">\r\n    <% @posts.in_groups_of(2, false) do |post_column| %>\r\n    <tr>\r\n        <% for post in post_column %>\r\n        <td class=\"grid-post\" style=\"width: 33.33%;\">\r\n          <h2 class=\"caption\"><%= post.title %>\r\n          </h2>\r\n          <div id=\"thumbnail\">\r\n          <%= image_tag post.featured_image, :class=>\"thumbnail\"%>\r\n          </div>\r\n          <p><%= truncate(Post.last.content, length: 200) %></p>\r\n        </td>\r\n        <% end %>\r\n      <tr>\r\n      <% end %>\r\n  </table>\r\n\r\n  <div id=\"sidebar\" style=\"float: right;\">\r\n    <div id=\"recent-posts\">\r\n      <h2> Recent Posts </h2>\r\n      <table>\r\n        <tr>\r\n          <%= recent_posts %>\r\n        </tr>\r\n\r\n  </div>\r\n</div>\r\n\r\n  </body>\r\n</html>\r\n\r\n```"},"comment":{"url":"https://api.github.com/repos/ga-wdi-exercises/project1/issues/comments/200026558","html_url":"https://github.com/ga-wdi-exercises/project1/issues/242#issuecomment-200026558","issue_url":"https://api.github.com/repos/ga-wdi-exercises/project1/issues/242","id":200026558,"user":{"login":"RobertAKARobin","id":6268177,"avatar_url":"https://avatars.githubusercontent.com/u/6268177?v=3","gravatar_id":"","url":"https://api.github.com/users/RobertAKARobin","html_url":"https://github.com/RobertAKARobin","followers_url":"https://api.github.com/users/RobertAKARobin/followers","following_url":"https://api.github.com/users/RobertAKARobin/following{/other_user}","gists_url":"https://api.github.com/users/RobertAKARobin/gists{/gist_id}","starred_url":"https://api.github.com/users/RobertAKARobin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RobertAKARobin/subscriptions","organizations_url":"https://api.github.com/users/RobertAKARobin/orgs","repos_url":"https://api.github.com/users/RobertAKARobin/repos","events_url":"https://api.github.com/users/RobertAKARobin/events{/privacy}","received_events_url":"https://api.github.com/users/RobertAKARobin/received_events","type":"User","site_admin":false},"created_at":"2016-03-22T21:05:43Z","updated_at":"2016-03-22T21:05:43Z","body":"You posted this on Project 1, Kaira. Can you please repost to Project 2?"}}