When I looked it up online, it said that the cause was a mismatch between the file name and the class name, but the file name is
timelists_controller.rb and the code matches the class name as follows:Please tell me how to resolve it.
class TimelistsController<ApplicationController before_action —require_user_logged_in def index @timelists=Timelist.all end def create @timelist=Timelist.new(time_params) [email protected] flash.now [:success] = "Posted." render "toppages/index" else flash.now [:danger] = "Post failed." render "toppages/index" end end def destroy @timelist=Timelist.find (params[:id]) @timelist.destroy flash.now [:success] = "Your behavior has been logged." render "times.index" end def time_params param.require(:timemanagement).permit(:content) end end
The method in the
TimelistsController class references
Timelist, but because it is not defined anywhere, it is
Timelist is defined under the
TimelistsController or is defined at the top level, no error occurs.
356 I want to create an array of sequences from "1" to a specified number.
340 Memory layouts learned in theory don't work out as expected when actually printed as addresses.
353 I have saved several codes written in python to a visual studio file.
© 2023 OneMinuteCode. All rights reserved.