Help us understand the problem. What is going on with this article?

#NoMethodError in Messages#index -undefined method `format_posted_time'

More than 1 year has passed since last update.

ActionView::Template::Error (undefined method `format_posted_time' for #<#Class:0x007ff1a676f6c0:0x007ff1a69035b8>):
3: .upper-message_user-name
4: = message.user.name
5: .upper-message
date
6: = format_posted_time(message.created_at)
7: .lower-meesage
8: - if message.content.present?
9: %p.lower-message
_content

helper method `format_posted_time'が定義されていない。

6: = format_posted_time(message.created_at)

1.app/helpers/application_helper.rb
2.定義を記述
module ApplicationHelper
def format_posted_time(time)
time.to_s(:default)
end
end

w3emazawa
修行中のプログラマです。Ruby,Rails,Git,HTML,CSS
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away