mirror of
https://github.com/TracksApp/tracks.git
synced 2026-02-09 09:04:21 +01:00
small improvements
render :partial => filename, :object => @object can be written shorter since rails 2.0 like render :partial => @object or render :partial => @collection Also form_for is smart bout put and post for update and creation. it helps watching older railcasts episodes :-)
This commit is contained in:
parent
edb3668dba
commit
484356fe07
15 changed files with 51 additions and 52 deletions
|
|
@ -1,7 +1,7 @@
|
|||
<div class="container" id="note-<%= note.id %>-wrapper">
|
||||
<div id="<%= dom_id(note, 'container') %>">
|
||||
|
||||
<h2><%= link_to(t('notes.note_header', :id => note.id.to_s), note_path(note), :title => t('notes.note_link_title', :id => note.id.to_s)) %></h2>
|
||||
<h2><%= link_to(t('notes.note_header', :id => note.id.to_s), note, :title => t('notes.note_link_title', :id => note.id.to_s)) %></h2>
|
||||
|
||||
<div class="project_notes" id="<%= dom_id(note) %>">
|
||||
<%= render :partial => "notes/note_details", :object => note %>
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
<%= link_to_delete_note(note, image_tag( "blank.png",:title => t('notes.delete_item_title'), :class=>"delete_item")) %>
|
||||
<%= link_to_edit_note(note, image_tag( "blank.png", :title => t('notes.edit_item_title'), :class=>"edit_item") ) %>
|
||||
|
||||
| <%= link_to("In: " + note.project.name, project_path(note.project), :class=>"footer_link" ) %> |
|
||||
| <%= link_to("In: " + note.project.name, note.project, :class=>"footer_link" ) %> |
|
||||
|
||||
<%= Note.human_attribute_name('created_at') %>: <%= format_date(note.created_at) %>
|
||||
|
||||
|
|
|
|||
|
|
@ -1,12 +1,9 @@
|
|||
<%
|
||||
submit_text ||= t('common.update')
|
||||
# :put for edit note and :post for new note
|
||||
form_method ||= :put
|
||||
|
||||
form_for(note_edit_form, :html => {
|
||||
:id => dom_id(note_edit_form, 'edit_form'),
|
||||
:class => "inline-form edit-note-form",
|
||||
:method => form_method }) do |f|
|
||||
:class => "inline-form edit-note-form"}) do |f|
|
||||
-%>
|
||||
|
||||
<div id="error_status"><%= error_messages_for("note") %></div>
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
<div class="note_wrapper" id="<%= dom_id(note) %>">
|
||||
<%= link_to(
|
||||
image_tag("blank.png", :border => 0),
|
||||
note_path(note),
|
||||
note,
|
||||
:title => t('notes.show_note_title'),
|
||||
:class => "link_to_notes icon",
|
||||
:id => dom_id(note, "link")) %>
|
||||
|
|
|
|||
|
|
@ -2,6 +2,6 @@
|
|||
<% if @all_notes.empty? -%>
|
||||
<div class="message"><p><%= t('notes.no_notes_available') %></p></div>
|
||||
<% else -%>
|
||||
<%= render :partial => 'note', :collection => @all_notes %>
|
||||
<%= render :partial => @all_notes %>
|
||||
<% end -%>
|
||||
</div>
|
||||
|
|
@ -1,3 +1,3 @@
|
|||
<div id="display_box_projects">
|
||||
<%= render :partial => 'note', :object => @note %>
|
||||
<%= render :partial => @note %>
|
||||
</div>
|
||||
Loading…
Add table
Add a link
Reference in a new issue