diff --git a/app/controllers/authors_controller.rb b/app/controllers/authors_controller.rb index 3467ccf..537911e 100644 --- a/app/controllers/authors_controller.rb +++ b/app/controllers/authors_controller.rb @@ -12,7 +12,7 @@ def new end def edit - @article = Author.find(params[:id]) + @author = Author.find(params[:id]) end def create diff --git a/app/views/authors/edit.html.erb b/app/views/authors/edit.html.erb index 5306d63..67e9f4c 100644 --- a/app/views/authors/edit.html.erb +++ b/app/views/authors/edit.html.erb @@ -1,15 +1,15 @@

Editing author

-<%= form_for :article, url: article_path(@article), method: :patch do |f| %> +<%= form_for :author, url: author_path(@author), method: :patch do |f| %> - <% if @article.errors.any? %> + <% if @author.errors.any? %>

- <%= pluralize(@article.errors.count, "error") %> prohibited - this article from being saved: + <%= pluralize(@author.errors.count, 'error') %> prohibited + this author from being saved:

@@ -17,13 +17,18 @@ <% end %>

- <%= f.label :title %>
- <%= f.text_field :title %> + <%= f.label :first_name %>
+ <%= f.text_field :first_name %>

- <%= f.label :text %>
- <%= f.text_area :text %> + <%= f.label :last_name %>
+ <%= f.text_field :last_name %> +

+ +

+ <%= f.label :homepage %>
+ <%= f.text_field :homepage %>

@@ -32,4 +37,4 @@ <% end %> -<%= link_to 'Back', articles_path %> \ No newline at end of file +<%= link_to 'Back', authors_path %> \ No newline at end of file