[openstreetmap-website] user changeset atom feed lacks a title (#1051)

Aditya Prakash notifications at github.com
Fri Nov 13 06:17:15 UTC 2015

This is because `@title` for feed request is never set. [Here](https://github.com/openstreetmap/openstreetmap-website/blob/master/app/views/changeset/list.atom.builder#L5) `@title` is nil:
 feed.title @title

On html request `@title` is set [here](https://github.com/openstreetmap/openstreetmap-website/blob/master/app/views/changeset/history.html.erb#L8-L20):

  if params[:friends] and @user
     set_title(t 'changeset.list.title_friend')
     @heading = t 'changeset.list.title_friend'
   elsif params[:nearby] and @user
     set_title(t 'changeset.list.title_nearby')
     @heading = t 'changeset.list.title_nearby'
   elsif params[:display_name]
     set_title(t 'changeset.list.title_user', :user => params[:display_name])
     @heading = t('changeset.list.title_user', :user => link_to(params[:display_name], :controller => "user", :action => "view", :display_name => params[:display_name])).html_safe
     set_title(t 'changeset.list.title')
     @heading = t 'changeset.list.title'

Can't all that logic be moved to a helper function which can be called from both history.html.erb and list.atom.builder?

Reply to this email directly or view it on GitHub:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20151112/4cc5190d/attachment.html>

More information about the rails-dev mailing list