From 30769669e388104626bfc9bd8e9680c4fcee25cc Mon Sep 17 00:00:00 2001 From: Sean Collins Date: Thu, 24 Sep 2015 10:15:52 -0600 Subject: Remove to_s example It's outside the scope of the Engines guide [skip ci] --- guides/source/engines.md | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) (limited to 'guides/source') diff --git a/guides/source/engines.md b/guides/source/engines.md index a3cff2a807..54cee03df9 100644 --- a/guides/source/engines.md +++ b/guides/source/engines.md @@ -843,28 +843,10 @@ above the "Title" output inside `app/views/blorgh/articles/show.html.erb`: ```html+erb

Author: - <%= @article.author %> + <%= @article.author.name %>

``` -By outputting `@article.author` using the `<%=` tag, the `to_s` method will be -called on the object. By default, this will look quite ugly: - -``` -# -``` - -This is undesirable. It would be much better to have the user's name there. To -do this, add a `to_s` method to the `User` class within the application: - -```ruby -def to_s - name -end -``` - -Now instead of the ugly Ruby object output, the author's name will be displayed. - #### Using a Controller Provided by the Application Because Rails controllers generally share code for things like authentication -- cgit v1.2.3