I have a model named "notice.rb" with a corresponding controller
"notices_controller.rb" and my db table "notices" contains two text
fields - title and body.
I want to save this table data as an html file in a external
directory. Please help me and suggest me ways to do it. NB: This html
file is not the view corresponding to this model but it should be a
different "html file". You can say that its like exporting data in
Here is my code for the model and controller....
class NoticesController < ApplicationController
@notice = Notice.new(params[:notice])
flash.now[:notice] = "Notice created successfully"
render :action => 'show'
@notice = Notice.find(:all)
class Notice < ActiveRecord::Base
validates_presence_of :title, :body
attr_accessible :title, :body