Created
April 1, 2020 23:03
-
-
Save davidmyersdev/fa7c08933c4b40a197289dc3017668f5 to your computer and use it in GitHub Desktop.
Interpolating data into Rails views -- Controller segment
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# app/controllers/notifications_controller.rb | |
class NotificationsController < ApplicationController | |
helper_method :notifications | |
def index | |
# automatically renders app/views/notifications/index.html.erb | |
end | |
private | |
def notifications | |
Notification.all | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment