This model is a model so it should behaves like one
This commit is contained in:
parent
c24c9def36
commit
be6ff39199
@ -88,18 +88,14 @@ def generate_blog_route_in_view
|
||||
@plugin.write "app/models/blog/post.rb", <<-RUBY
|
||||
module Blog
|
||||
class Post
|
||||
extend ActiveModel::Naming
|
||||
include ActiveModel::Model
|
||||
|
||||
def id
|
||||
44
|
||||
end
|
||||
|
||||
def to_param
|
||||
id.to_s
|
||||
end
|
||||
|
||||
def new_record?
|
||||
false
|
||||
def persisted?
|
||||
true
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user