I'm not sure if I overdo it, but would like to receive some recommendations and recommendations for this scenario.
I have two applications that you can enter and execute your main CRUD, i.e. create blog entries, and the second is to view the same application, but you won’t be able to log in and not create a blog entry. The second application will be read from the same database as the first.
My question is how can I get two applications reading the same model in development, and I still need to create my models with columns, etc. in view-only application?
Example
Appendix 1 (with CRUD)
class Post < ActiveRecord::Base
extend FriendlyId
friendly_id :title, use: :slugged
belongs_to :category
belongs_to :user
has_many :images, as: :imageable, :dependent => :destroy
accepts_nested_attributes_for :images
attr_accessible :comments, :title, :category_id, :user_id, :image_id, :images_attributes, :imageable_id, :imageable_attributes, :slug
validates :comments, :presence => {:message => 'Add your Comments'}
validates :title, :presence => {:message => 'Add your Title'}
scope :latest_posts, :order => "posts.created_at DESC"
def self.search(search)
where("title like ?", "%#{search}%")
end
end
Appendix 2 (No Crud)
class Post < ActiveRecord::Base
end
I would really appreciate an explanation of what is going on in this kind of setup.
thanks