Hello,
I have a problem with showing slides in a row. I would like to have a
slideshow which would show all pictures. I am learning RUby so this
example is from book 'Ruby on Rails". I am using Rails 2.3.5. Below
the code that I use. The error that I am getting since Monday is:
ActionController::UnknownAction (No action responded to show_slide.
Actions: create, destroy, edit, index, new, show, and update)
I have included
<%= javascript_include_tag :defaults %>
in app/views/layouts/application.html.erb
Could you help me? I have no idea why it doesn’t work.
-------------------------------------------app/views/slideshows/
show.html.erb --------------- begin
<%= @slideshow.name %>
<% if @slide %><%= periodically_call_remote :update => ‘slides’,
:url => { :action
=> :show_slide },
:frequency => 1 %>
<% end %>
<%= link_to ‘Edit’, edit_slideshow_path(@slideshow) %> |
<%= link_to ‘Back’, slideshows_path %>
-------------------------------------------app/views/slideshows/
show.html.erb --------------- end
-------------------------------------------app/views/slideshows/
_show_slide.html.erb --------------- begin
<%= image_tag “photos/#{@slide.photo.filename}” %>
<%= @slide.photo.filename %>
-------------------------------------------app/views/slideshows/ _show_slide.html.erb --------------- end-------------------------------------------app/controllers/
slideshows_controller.rb --------------- begin
.
.
def show_slide
@slideshow = session[:slideshow]
session[:slide_index] += 1
@slide = @slideshow.slides[session[:slide_index]]
if @slide == nil
session[:slide_index] = 0
@slide = @slideshow.slides[0]
end
render :partial => “show_slide”
end
-------------------------------------------app/controllers/
slideshows_controller.rb --------------- end