Ruby on Rails Thursday, February 26, 2015

I am getting this error while clicking on continue reading button,for
only one article.there is also a difference url in frontend and backend
like

https://example.com/uploads/research_article/pdf/54efa4101106f2193c000008/Even_Moderate_Visual_Impairments_degrade_drivers_ability_to_see_pedestrians_at_night.pdf
in front end

and while uploading the file is
https://vii-production.s3.amazonaws.com/uploads/research_article/pdf/54efa4181106f29c97000023/Even_Moderate_Visual_Impairments_degrade_drivers_ability_to_see_pedestrians_at_night.pdf



errror is

This XML file does not appear to have any style information
associated with it. The document tree is shown below.
<Error><Code>NoSuchKey</Code><Message>The specified key does not
exist. </Message>
<Key>uploads/research_article/pdf/54efa4101106f2193c000008/Even_Moderate_Visual_Impairments_degrade_drivers_ability_to_see_pedestrians_at_night.pdf</Key><RequestId>D82A8EFA8D8FE524</RequestId><HostId>Js3D/1559nLIQ8CmCyIsV99bDc3sPy/jj+UHPZuaDo3g8glLysboi9Xs5UxqNt+B</HostId></Error>


app\controllers\research_controller.rb

def download
@article = ResearchArticle.where(:url_fragment =>
params[:url_fragment]).first
send_remote_carrierwave_file(@article.pdf)
end

app\views\home\index\_report.html.erb

div class='supporting_text'>
<%= strip_tags(truncate_html(atom.summary, :length => 120)) %>
</div>

<%= render :partial => '/components/minimal_call_to_action', :locals
=> {:atom => atom, :call_to_action_text => 'Continue Reading',
:call_to_action_url => research_article_path(:url_fragment =>
atom.url_fragment) } %>
</div>


app\views\research\index\_article.html.erb

<div class='filters'>
<%= ((atom.population_categories.map {|category| "<a
class='article_filter' data-type='population_category_ids[]'
data-id='#{category.id}'>#{category.title}</a>" } +
atom.geographic_regions.map {|region| "<a class='article_filter'
data-type='geographic_region_ids[]'
data-id='#{region.id}'>#{region.title}</a>" }) * ' ').html_safe %>
</div>

<% if defined?(longform) && longform %>
<% if atom.pdf.present? %>
<%= render :partial => '/components/minimal_call_to_action', :locals
=> {:atom => atom, :call_to_action_url => atom.pdf_url,
:call_to_action_text => 'Continue Reading', :target => :_blank} %>
<% end %>
<% else %>
<%= render :partial => '/components/minimal_call_to_action', :locals
=> {:atom => atom, :call_to_action_url =>
research_article_path(:url_fragment => atom.url_fragment),
:call_to_action_text => 'Continue Reading'} %>
<% end %>

--
Posted via http://www.ruby-forum.com/.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/d946f7ba56efe0981cdd1b3a5277bc66%40ruby-forum.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment