Change attribute name to content

This commit is contained in:
Ryan W
2021-12-16 14:32:18 -08:00
parent 9cf88160e1
commit ff87f2c67e
6 changed files with 7 additions and 6 deletions
+1 -1
View File
@@ -64,6 +64,6 @@ class ArticlesController < ApplicationController
# Only allow a list of trusted parameters through.
def article_params
params.require(:article).permit(:title, :text)
params.require(:article).permit(:title, :content)
end
end
+1
View File
@@ -1,4 +1,5 @@
class Article < ApplicationRecord
has_rich_text :text
has_rich_text :content
validates_presence_of :title
end
+1 -1
View File
@@ -1,2 +1,2 @@
json.extract! article, :id, :title, :text, :created_at, :updated_at
json.extract! article, :id, :title, :content, :created_at, :updated_at
json.url article_url(article, format: :json)
+2 -2
View File
@@ -17,8 +17,8 @@
</div>
<div class="field">
<%= form.label :text %>
<%= form.rich_text_area :text %>
<%= form.label :content %>
<%= form.rich_text_area :content %>
</div>
<div class="actions">