forked from bofh/fetsite
calentry inline form
This commit is contained in:
@@ -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>
|
||||
|
||||
10
app/views/calentries/_nested_form.html.erb
Normal file
10
app/views/calentries/_nested_form.html.erb
Normal 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 %>
|
||||
2
app/views/calentries/edit.js.erb
Normal file
2
app/views/calentries/edit.js.erb
Normal file
@@ -0,0 +1,2 @@
|
||||
alert("sdf");
|
||||
$("#calentry_<%= @calentry.id %>").html("<%=escape_javascript( render :partial=>"nested_form" ,:object=>@calentry)%>");
|
||||
1
app/views/calentries/update.js.erb
Normal file
1
app/views/calentries/update.js.erb
Normal file
@@ -0,0 +1 @@
|
||||
$("#calentry_<%= @calentry.id %>").replaceWith("<%=escape_javascript( render :partial=>"calentry", :object=>@calentry)%>");
|
||||
Reference in New Issue
Block a user