Open
Description
I have a index.html.erb (Question Controller)
def index
@questions = Question.all
respond_to do |format|
format.html {render layout: false}
format.json { render json: @questions }
end
end
In another View home.html.erb (StaticPageController)
<div id="test">
<a href="/questions"><img alt="attendence"
class="img-rounded" height="60" src="/assets/marks.gif"
width="60" /></a>
</div>
and a target div in home.html.erb
<div data-pjax>
</div>
I use pjax to grab the contents from index controller and display in the target div
In the file static_pages.js.coffee
JQuery ->
('#test a').pjax('[data-pjax]')
on clicking the link, it goes to a new page and does not replace the target DIV
I followed the Railcasts posted here to get till here.. what am i missing?
Metadata
Metadata
Assignees
Labels
No labels