Ujs in rails
Upcoming SlideShare
Loading in...5
×
 

Ujs in rails

on

  • 208 views

 

Statistics

Views

Total Views
208
Views on SlideShare
208
Embed Views
0

Actions

Likes
0
Downloads
1
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Ujs in rails Ujs in rails Presentation Transcript

  • UJS in Rails
  • UJS in RailsInstead of inserting inline JS, Rails 3 uses HTML5data-attributes
  • Sample= link_to “delete”, posts_path(@post), :method => “delete”, :confirm => “Areyou sure?”…will render as:<a href=“/posts/1” data-confirm=“Are you sure?” data-method=“delete”>delete</a>
  • No more ‘remote’ helpers (link_to_remote,remote_form_for, et al., are gone)
  • :remote
  • Sample= form_for(@posts, :remote => true)…will render as<form action=“http://post/path” method=“post” data-remote=“true”></form>
  • Questions?