I've been really getting into Refinery and so far it's great!
I wanted to create a title and description for images uploaded to
Refinery using Portfolio
so far I have done the following;
added the columns to the images table
$script/generate migration AddTitleToImages title:string
$script/generate migration AddBodyToImages body:text
$rake db:migrate
modified the field div in this file, * highlighted
vendor/plugins/images/app/views/admin/images/_form.html.erb
<div class='field'>
<%= f.label :uploaded_data, 'Image' %>
<% if params[:action] =~ /(edit)|(update)/ %>
Use current image
<em>or</em>, replace it with this one...
<% end %>
<%= f.file_field :uploaded_data %>
***** <%= f.label :title, 'Title' %>
***** <%= f.text_field :title %>
***** <%= f.label :body, 'Description' %>
***** <%= f.text_area :body, :class => "wymeditor", :rows => 7 %>
</div>
Added these lines to the main image partial in
vendor/plugins/refinerycms-portolio/app/views/portfolio/
_main_image.html.erb
<h2><%= @image.title %></h2>
<p><%= @image.body %><p>
This works in the back-end except for a few visual bugs.
The problem with this is when i click through the thumbnails in the
front-end the titles and descriptions keep stacking on top of the
previous titles and descriptions. The main image changes fine, but
instead of refreshing the title and description, it adds the new one
above the previous titles and descriptions.
How can i stop this repetition so that only one title and description
will show at a time?
thanks in advance,
John