8000 pjax call doesn't replace data-pjax div with new content · Issue #23 · eval/rack-pjax · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
pjax call doesn't replace data-pjax div with new content #23
Open
@anilmuppalla

Description

@anilmuppalla

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

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0