Search Results

Search found 3 results on 1 pages for 'pruett'.

Page 1/1 | 1 

  • Ruby on Rails AJAX call affects only the first element in collection

    - by pruett
    I'm iterating over a collection of elements and trying to get AJAX to work properly on a specific element within the collection. I'm nesting a few partials in order to iterate over these items and use a js.erb call like this: $('#favorite_form').html("<%=j render partial: 'shared/unfavorite', locals: { mission: @mission } %>"); This only seems to change the 1st item in the collection even though I could be clicking the 5th item down the list, for example. Question: How can I specify (via .js and AJAX) which element to update? Is this jQuery call not specific enough to the individual element? The code works in regular HTTP requests, so I'm wondering if there is a way to specify the individual element, but I thought that's what partials did :/ Example View ( _favorites.html.erb ) <div id="favorite_form"> <% if you_favorited_this?(current_user, mission) %> <%= render partial: 'shared/unfavorite', locals: { mission: mission } %> <% else %> <%= render partial: 'shared/favorite', locals: { mission: mission } %> <% end %> </div>

    Read the article

  • Google I/O 2010 - Writing real-time games for Android redux

    Google I/O 2010 - Writing real-time games for Android redux Google I/O 2010 - Writing real-time games for Android redux Android 201 Chris Pruett This session is a crash course in Android game development: everything you need to know to get started writing 2D and 3D games, as well as tips, tricks, and benchmarks to help your code reach optimal performance. In addition, we'll discuss hot topics related to game development, including hardware differences across devices, using C++ to write Android games, and the traits of the most popular games on Market. For all I/O 2010 sessions, please go to code.google.com From: GoogleDevelopers Views: 10 0 ratings Time: 58:57 More in Science & Technology

    Read the article

1