Skip to content

Instantly share code, notes, and snippets.

@leofrozenyogurt
Created May 22, 2013 04:31
Show Gist options
  • Save leofrozenyogurt/5625251 to your computer and use it in GitHub Desktop.
Save leofrozenyogurt/5625251 to your computer and use it in GitHub Desktop.
SHOW.JS.ERB
$("#video_div").html("<%= escape_javascript(render(:partial => "client_stories/client_story")) %>");
!-------------!
INDEX.HTML.ERB
<div id='main_profile_column'>
<div id="video_div">
<% @client_stories.each do |client_story| %>
<%= render 'client_stories/client_story', :client_story => client_story %>
<% end %>
<% @client_stories.each do |client_story| %>
<%=link_to client_story.client, client_story, :remote=> true%>
<%end%>
</div>
</div>
!----------------!
_Client_story.html.erb
<div class="container">
<div class="row-fluid">
<div class="span12">
<p id="notice"><%= notice %></p>
<div class="row-fluid">
<!-- logo -->
<div class="span2 ">
<b>Clogo:</b>
<%= client_story.clogo %>
</div>
<!-- story -->
<div class="span5 ">
<h1><%= client_story.client %></h1>
<h3><%= client_story.teaser %></h3>
<p><%= client_story.description %></p>
</div>
<!-- video/quote -->
<div class="span5 ">
<b>Video:</b>
<%= client_story.video %>
<h3><%= client_story.quote %></h3> - JOHN DOE, CEO
</div>
</div>
</div>
</div>
</div>
CONTROLLER
def index
@client_stories = ClientStory.all
respond_to do |format|
format.html # index.html.erb
format.js { render "client_story" }
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment