Notifications using noticed gem Ruby on rails

Viewed 30

I'm writing the documentation about my Rails' project and I have a question. I developed the notification's mechanism with the GoRails tutorial and the code is something like this, Me question is this is a controller or a model logic? I think controller logic but I am not sure

class EventNotification < Noticed::Base
    deliver_by :database
 
    def message
      @group=Group.find(params[:group][:id])
      @user=User.find(params[:user][:id])
      @event=Event.find(params[:event][:id])
      "#{@event.user.username} invite you in #{@event.title} into #{@group.name} click here to visit"
    end
  
    #
    def url
     group_event_path(Group.find(params[:group][:id]), Event.find(params[:event][:id]) )
    end
  end

  
0 Answers
Related