]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/diary_entry_controller.rb
Use BETWEEN for the node selection in the map API call as MySQL seems to
[rails.git] / app / controllers / diary_entry_controller.rb
index b072fc0e364e5dd58f86f05bc6e5f78c0bb31bb6..e763dfd7225ef7eaff433ca618fbebe8773077ed 100644 (file)
@@ -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,10 +41,7 @@ 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
 
     render :text => rss.to_s, :content_type => "application/rss+xml"