calentry inline form

This commit is contained in:
Andreas Stephanides
2014-10-28 08:43:44 +01:00
parent 2622ed1513
commit 2688bca831
8 changed files with 41 additions and 2 deletions

View File

@@ -9,5 +9,5 @@ format =:default
end%>
<%= calentry.text %>
<%= link_to "edit", edit_calentry_path(calentry) if can? :edit, calentry %>
<%= link_to "edit", edit_calentry_path(calentry),:remote=>true if can? :edit, calentry %>
</div>

View File

@@ -0,0 +1,10 @@
<%= fa_icon("calendar 2x") %>
<%= semantic_form_for @calentry, :remote=>true, :html=>{:class=>"inline"} do |f| %>
<%= f.input :start, :as => :datetimepicker %>
<%= f.input :dauer , :as => :string, :append=>"h" %>
<%= f.action :submit, :as => :input_ %>
<% end %>

View File

@@ -0,0 +1,2 @@
alert("sdf");
$("#calentry_<%= @calentry.id %>").html("<%=escape_javascript( render :partial=>"nested_form" ,:object=>@calentry)%>");

View File

@@ -0,0 +1 @@
$("#calentry_<%= @calentry.id %>").replaceWith("<%=escape_javascript( render :partial=>"calentry", :object=>@calentry)%>");