@@ -47,27 +47,27 @@ def index
4747 preload ( :project , :user )
4848
4949 respond_to do |format |
50- format . html {
50+ format . html do
5151 @entry_count = scope . count
5252 @entry_pages = Paginator . new @entry_count , per_page_option , params [ 'page' ]
5353 @entries = scope . offset ( @entry_pages . offset ) . limit ( @entry_pages . per_page ) . to_a
5454
5555 render :layout => !request . xhr?
56- }
57- format . api {
56+ end
57+ format . api do
5858 @entry_count = scope . count
5959 @offset , @limit = api_offset_and_limit
6060 @entries = scope . offset ( @offset ) . limit ( @limit ) . preload ( :custom_values => :custom_field ) . to_a
61- }
62- format . atom {
61+ end
62+ format . atom do
6363 entries = scope . limit ( Setting . feeds_limit . to_i ) . reorder ( "#{ TimeEntry . table_name } .created_on DESC" ) . to_a
6464 render_feed ( entries , :title => l ( :label_spent_time ) )
65- }
66- format . csv {
65+ end
66+ format . csv do
6767 # Export all entries
6868 @entries = scope . to_a
6969 send_data ( query_to_csv ( @entries , @query , params ) , :type => 'text/csv; header=present' , :filename => 'timelog.csv' )
70- }
70+ end
7171 end
7272 end
7373
@@ -117,7 +117,7 @@ def create
117117
118118 if @time_entry . save
119119 respond_to do |format |
120- format . html {
120+ format . html do
121121 flash [ :notice ] = l ( :notice_successful_create )
122122 if params [ :continue ]
123123 options = {
@@ -139,7 +139,7 @@ def create
139139 else
140140 redirect_back_or_default project_time_entries_path ( @time_entry . project )
141141 end
142- }
142+ end
143143 format . api do
144144 render :action => 'show' , :status => :created , :location => time_entry_url ( @time_entry )
145145 end
@@ -163,10 +163,10 @@ def update
163163
164164 if @time_entry . save
165165 respond_to do |format |
166- format . html {
166+ format . html do
167167 flash [ :notice ] = l ( :notice_successful_update )
168168 redirect_back_or_default project_time_entries_path ( @time_entry . project )
169- }
169+ end
170170 format . api { render_api_ok }
171171 end
172172 else
@@ -237,21 +237,21 @@ def destroy
237237 end
238238
239239 respond_to do |format |
240- format . html {
240+ format . html do
241241 if destroyed
242242 flash [ :notice ] = l ( :notice_successful_delete )
243243 else
244244 flash [ :error ] = l ( :notice_unable_delete_time_entry )
245245 end
246246 redirect_back_or_default project_time_entries_path ( @projects . first ) , :referer => true
247- }
248- format . api {
247+ end
248+ format . api do
249249 if destroyed
250250 render_api_ok
251251 else
252252 render_validation_errors ( @time_entries )
253253 end
254- }
254+ end
255255 end
256256 end
257257
0 commit comments