में टाइमस्टैम्प कैसे सम्मिलित करें मैंने अभी आरओआर के साथ शुरुआत की है और एक प्रश्न है: मैं मॉडल में वर्तमान टाइमस्टैम्प (या किसी भी प्रकार का समय) कैसे डाल सकता हूं? नीचे आप लॉग फ़ंक्शन बनाते हैं।रेल डेटाबेस डेटाबेस-कॉलम
def create
@log = Log.new(params[:log])
respond_to do |format|
if @log.save
format.html { redirect_to @log, notice: 'Log was successfully created.' }
format.json { render json: @log, status: :created, location: @log }
else
format.html { render action: "new" }
format.json { render json: @log.errors, status: :unprocessable_entity }
end
end
end
क्या आपने रेल जनरेटर का उपयोग करके मॉडल बनाया था? –