nosuch code error,

19 views
Skip to first unread message

Sailatha K.

unread,
Feb 27, 2015, 2:36:13 AM2/27/15
to rubyonra...@googlegroups.com
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/.

Hassan Schroeder

unread,
Feb 27, 2015, 4:11:35 PM2/27/15
to rubyonrails-talk
On Thu, Feb 26, 2015 at 11:33 PM, Sailatha K. <li...@ruby-forum.com> wrote:
> I am getting this error while clicking on continue reading button,for
> only one article.

> 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>

That's an Amazon S3 message - you need to figure out the correct
URL for your bucket/objects.

--
Hassan Schroeder ------------------------ hassan.s...@gmail.com
http://about.me/hassanschroeder
twitter: @hassan
Consulting Availability : Silicon Valley or remote
Reply all
Reply to author
Forward
0 new messages