Feature/edit button on results

This feature adds Edit and Destroy buttons to the search results and detailed search results. Only authorized users can see the buttons. 
After the feature is implemented I suggest we modify nyucore.rb#index, which now lists all nyucores object without pagination. 
The following files were added:
﻿app/views/catalog/_document.html.erb
app/views/catalog/_show_default.html.erb
features/edit_button_on_results.feature
feature/step_definitions/edit_button_steps.rb
The following files were modified
app/controllers/nyucore_controller.rb
feature/step_definitions/record_steps.rb


I will use search_id from session and document counter and recreate initial
search from those params as I did initially. It's a bit long and clumsy but
looks like a standard approach. Hall of fame people use
set_next_and_previous_document method which does the same.

On Thu, Nov 6, 2014 at 2:30 PM, barnabyalter <notifications@github.com>
wrote:

> In app/controllers/nyucores_controller.rb:
>
> >    end
> >
> >    def destroy
> >      authorize! :destroy, params[:id]
> >      @item = Nyucore.find(params[:id])
> >      @item.destroy
> > -    respond_with(@item, :location => nyucores_path)
> > +    flash[:notice] = "Item was successfully deleted.#{request.env["HTTP_REFERER"]}"
> > +    redirect_to request.referer
>
> @ekate <https://github.com/ekate> Use referer for now then and in the
> long run I think we'd want this to be an ajax request.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/NYULibraries/ichabod/pull/49/files#r19968141>.
>



-- 
Ekaterina Pechekhonova
Digital Library Programmer/Analyst
New York University
Libraries
email: ekate@nyu.edu
phone: 212-992-9993