ruby on rails - Turbolinks 3 and render a partial -


i'm excited turbolinks3(it allows render partial , not reload body) can read more here: https://github.com/rails/turbolinks/blob/master/changelog.md it's amazing i've problem: in browsers doesn't support pushstate(example ie8/9), don't know how manage behavior. give me error on ie8:

could not set innerhtml property. invalid target element operation. 

my controller code is:

  def create     @post = post.find(params[:post_id])      if @post.comments.create(comment_params)       render '_comment', change: [:comments, :super_test], layout: false, :locals => { comment: @post.comments.last }     else       render json:'error'     end   end 

a 'solution' do:

redirect_to @post, change: [:comments, :super_test] 

but problem reply lot of data don't need!(and response time bigger) reallt want find solution.

how can resolve problem ? i've thought 2 solution: 1) use history.js / modernizr polyfill pushstate on old browsers

2) find way check if request done turbolinks/pjax or not...and use conditional render or redirect_to

  • but i've not idea on how can it, because turbolinks doesn't send specific header jquery-pjax

any suggestions ? appreciate it!

ps: please don't suggest me backbone/angular/ember/react, know them(backbone), want try turbolinks.

your first instinct right, ie8 you'll need modernizr. problem neither code or turbolinks here, it's ie8.

ps: turbolinks doesn't replace js frameworks, can use 1 of them if want. did use react , angular. turbolinks avoids re-loading same thing several times (wich feels magic).


Comments

Popular posts from this blog

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -

ubuntu - Selenium Node Not Connecting to Hub, Not Opening Port -