- default_lang = @user.preferences.where(:k => "diary.default_language").first
- lang_code = default_lang ? default_lang.v : @user.preferred_language
+ default_lang = current_user.preferences.where(:k => "diary.default_language").first
+ lang_code = default_lang ? default_lang.v : current_user.preferred_language
redirect_to :action => "view", :id => params[:id]
elsif params[:diary_entry] && @diary_entry.update_attributes(entry_params)
redirect_to :action => "view", :id => params[:id]
redirect_to :action => "view", :id => params[:id]
elsif params[:diary_entry] && @diary_entry.update_attributes(entry_params)
redirect_to :action => "view", :id => params[:id]
Notifier.diary_comment_notification(@diary_comment, user).deliver_now
end
end
# Add the commenter to the subscribers if necessary
Notifier.diary_comment_notification(@diary_comment, user).deliver_now
end
end
# Add the commenter to the subscribers if necessary
redirect_to :action => "view", :display_name => diary_entry.user.display_name, :id => diary_entry.id
rescue ActiveRecord::RecordNotFound
redirect_to :action => "view", :display_name => diary_entry.user.display_name, :id => diary_entry.id
rescue ActiveRecord::RecordNotFound
redirect_to :action => "view", :display_name => diary_entry.user.display_name, :id => diary_entry.id
rescue ActiveRecord::RecordNotFound
redirect_to :action => "view", :display_name => diary_entry.user.display_name, :id => diary_entry.id
rescue ActiveRecord::RecordNotFound
# require that the user is a administrator, or fill out a helpful error message
# and return them to the user page.
def require_administrator
# require that the user is a administrator, or fill out a helpful error message
# and return them to the user page.
def require_administrator
@lon = params[:lon] || -0.1
@lat = params[:lat] || 51.5
@zoom = params[:zoom] || 4
else
@lon = params[:lon] || -0.1
@lat = params[:lat] || 51.5
@zoom = params[:zoom] || 4
else