Ruby on Rails Thursday, June 4, 2015

This could possibly be a really stupid question, but I have a home page
which calls a partial to show the latest entry in a table called 'news'.
All I want to know is how to put the 'news.content' into a text box.
Partial is as follows:

<p>
<strong>Title:</strong>
<%= news.title %>

</p>

<p>
<strong>Details:</strong>
<%= news.content %>
</p>


The bit that calls this on my home page is as such:

<%= render partial: 'news/news', locals: { news: News.last } %>.

--
Posted via http://www.ruby-forum.com/.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/99d73d8e46eb6d699e2a38bfc9001361%40ruby-forum.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment