Setting which functions as a post. It has the variables: Title:string Description:text, Photo:image and Paragraph:text.
I have another controller which controls my Home, About, News and contact.
On my Home, I'm trying to access the title of the setting with the id 3. I can't figure it out. Do i need to define the controls for the settings in the page controller as well? How can I access it?.
Here is my code at the Home,
<% @setting.(id[3]) do |setting| %>
<h2><%= setting.title %></h2>
<% end %>
Error: Undified local varible or method 'id' for #<#
Would appreciate some help, or a push in the right direction. Thanks :)
@setting = Setting.find(3), and then in view put<h2><%= @setting.title %></h2>without all this<% @setting.(id[3]) do |setting| %>@settings = Settings.alland@setting = Setting.find(params[id]), I'll try it :)@settings = Setting.find([1,3])and then use each of them into view.<% @settings.each do |setting| %>and then<h2><%= setting.title %></h2>and<% end %>at the end.