Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Got show student ajax partial working!

  • Loading branch information...
commit c6ac0260950c4a9215a87c0e2dcdd134943f7446 1 parent a99a4d2
@mark-d-holmberg authored
View
6 app/assets/javascripts/pages.js.coffee
@@ -5,7 +5,11 @@ jQuery ->
$("#selectable").live 'click', (event) ->
$("#selectable").selectable
selected: ->
- alert( $("li.ui-selected").find("input[type=hidden]").val() )
+ id = $("li.ui-selected").find("input[type=hidden]").val()
+ $.ajax
+ url: "users/" + id + "/",
+ dataType: "script",
$('#user-list-content .pagination a').live 'click', (event) ->
$.getScript(this.href);
return false;
+
View
3  app/views/shared/user_search/_listing.html.erb
@@ -1,7 +1,6 @@
<section id="users-listing">
<%= form_tag root_path, :method => :get, :id => "user_search", :remote => true do %>
- <%= text_field_tag :search, params[:search], :size => 15 %>
- <%= submit_tag "Search", :name => nil %>
+ <%= text_field_tag :search, params[:search], :size => 24 %>
<% end %>
<div id="user-list-content">
View
6 app/views/users/_show_student.html.erb
@@ -0,0 +1,6 @@
+<div id="show-student-individual">
+ <% @student.each do |student| %>
+ <%= student.name.inspect %><br />
+ <%= student.email.inspect %>
+ <% end %>
+</div>
View
1  app/views/users/show.js.erb
@@ -0,0 +1 @@
+$('#result').html('<%= escape_javascript(render(:partial => "show_student")) %>');
Please sign in to comment.
Something went wrong with that request. Please try again.