I’m trying to develop a simple to-do list to learn RJS.
Thigns are working fine as long as I add new items. Let’s say I have
item 1 - delete
item 2 - delete
item 3 - delete
When I click delete on the item2 to delete it, the items does get
But that row becomes empty. The item 3 doesn’t get pushed up.
Does it mean that I should render the whole page or is there something
Here is my code to execute delete.
render :update do |page|
id = @params[:id]
span_name = ‘line-’ + id.to_s # delete line-2 for testing
I also tried page[span_name].delete but no result.
When I look into firebug , in both the cases I see the element 'line-2"
there. It means when I ask line-2 to be removed, the line-2 is not
removed. The browser just hides it and replaces the space by white