X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/1017c4c39a1a8523262f290ff20f999223a0572b..d9d625f65186e846d12431cefede8999f65ca4e5:/app/controllers/diary_entry_controller.rb diff --git a/app/controllers/diary_entry_controller.rb b/app/controllers/diary_entry_controller.rb index 2dbf8a0cb..e763dfd72 100644 --- a/app/controllers/diary_entry_controller.rb +++ b/app/controllers/diary_entry_controller.rb @@ -7,9 +7,9 @@ class DiaryEntryController < ApplicationController def new @title = 'new diary entry' if params[:diary_entry] - @entry = DiaryEntry.new(params[:diary_entry]) - @entry.user = @user - if @entry.save + @diary_entry = DiaryEntry.new(params[:diary_entry]) + @diary_entry.user = @user + if @diary_entry.save redirect_to :controller => 'diary_entry', :action => 'list', :display_name => @user.display_name end end @@ -41,15 +41,10 @@ class DiaryEntryController < ApplicationController end @entries.each do |entry| - # add geodata here - latitude = nil - longitude = nil - rss.add(latitude, longitude, entry.title, url_for({:controller => 'diary_entry', :action => 'list', :id => entry.id, :display_name => entry.user.display_name}), entry.body, entry.created_at) + rss.add(entry.latitude, entry.longitude, entry.title, entry.user.display_name, url_for({:controller => 'diary_entry', :action => 'list', :id => entry.id, :display_name => entry.user.display_name}), entry.body, entry.created_at) end - response.headers["Content-Type"] = 'application/rss+xml' - - render :text => rss.to_s + render :text => rss.to_s, :content_type => "application/rss+xml" end end