Comments (6)
+1, I am getting captions with a helper method defining an array of recent posts but not in the way you describe above.... did you resolve your issue?
<% @gallery_recent.each do |gallery| %>
<figure class="grid col-one-quarter mq2-col-one-half">
<a href="/ <%= gallery.path %> ">
<%= image_tag(gallery.images.first.thumbnail(geometry: "246x184").url) %>
<span class="zoom"></span>
</a>
<figcaption>
<a href="<%= gallery.path%>" class="arrow"><%= gallery.title %></a>
<p><%= gallery.caption_for_image_index(0).html_safe %></p>
</figcaption>
</figure>
Otherwise in my view I'm getting method_missing errors for each of the examples on the front page done the same way.
from refinerycms-page-images.
Or with vanilla ruby:
<% @page.images.each_with_index do |image, i| %>
<figure class="">
<a href="<%= image.image_name %>" name="<%= image.image_name %>">
<img src="<%= image.image_uid %>" alt="<%= image.image_name %>" >
</a>
<figcaption>
<p><%= @page.caption_for_image_index(i).html_safe %></p>
</figcaption>
</figure>
<% end %>
from refinerycms-page-images.
Just noticed that this will not work for the last place in the array for some reason. ^^^
from refinerycms-page-images.
and yeah, still getting a method missing.
from refinerycms-page-images.
Which version of refinerycms-page-images are you using?
Images with captions are in the master branch.
from refinerycms-page-images.
I have updated the example code for images_with_captions, which was missing an each
. It now reads
<ul id='gallery'>
<% @page.images_with_captions.each do |iwc| %>
<li>
<%= link_to image_tag(iwc[:image].thumbnail(geometry: "200x200#c").url),
iwc[:image].thumbnail(geometry: "900x600").url %>
<span class='caption'><%=raw iwc[:caption] %></span>
</li>
<% end %>
</ul>
Also changed the references within each iwc to iwc[:field]
format
from refinerycms-page-images.
Related Issues (20)
- Friendly_id version HOT 3
- Unable to install and activesupport error HOT 6
- No documentation available for integration with refinerycms-blog HOT 3
- Installing latest refinerycms-page-images for refinerycms edge HOT 1
- Could not find gem 'refinerycms-page-images (~> 3.0.0) x86-mingw32'
- Could not find gem 'refinerycms-page-images (~> 3.0.0) x86-mingw32' HOT 1
- Images tab state after validation fail HOT 2
- Unknown attribute error when saving pages HOT 9
- NoMethodError: private method `prepend' HOT 3
- unknown attribute 'images_attributes' for Refinery::Page if only added to extension HOT 2
- Tab name not translated HOT 1
- Slow page loading times HOT 1
- Heroku pre-compiling assets fails after Heroku deprecated user-env-compile HOT 5
- refinerycms-page-images HOT 2
- Unable to use Rails 5.2.0 because of version globalize and activerecord HOT 5
- Dependabot can't resolve your Ruby dependency files
- Dependabot can't resolve your Ruby dependency files
- Dependabot can't resolve your Ruby dependency files
- Dependabot can't resolve your Ruby dependency files
- Struggling to invalidate cached single image caption HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from refinerycms-page-images.