SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Hybrid View

  1. #1
    SitePoint Zealot
    Join Date
    Jul 2004
    Location
    NC
    Posts
    194
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    No template error when there is a template

    Hello,
    I have a method that's being called from a flash sendAndLoad function and, occasionally, our production errors show the rails method will
    trigger a no template error.

    Here's the rails method:

    Code:
      def get_video_details   
        begin
          render :template=>'/rss/get_details'
        rescue Exception => e
          logger.debug("**(get_details) e-->>#{e}")
        end
      end

    And here's the template for that method:

    Code:
    cache({:controller => "widget", :action => "get_details", :id => params[:id]}, {:expires => 15.minutes}) do
        ret=''
      
        @song = Song.find(params[:id])
        if @song && @song.video_url
            response = Net::HTTP.get_response(URI.parse(@song.video_url))
            case response
              when Net::HTTPRedirection then 
                ret = response['location']
            else
                logger.error("Either invalid use of get_video_details or error in video_url for song #{@song.id}:#{@song.video_url}")
            end
        end
    -%>  
    <%=ret-%>
    <% end -%>
    Any ideas how I could be getting this error:

    A ActionController::MissingTemplate occurred in widget#get_video_details:

    Missing template /u/apps/website/production/current/public/../config/../app/views/widget/get_details.rhtml
    /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/base.rb:1003:in `assert_existence_of_template_file'

    Thanks,
    Eric

  2. #2
    SitePoint Addict ruby-lang's Avatar
    Join Date
    Aug 2007
    Posts
    389
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Looks like it's trying to render the default view, that would be in widget/get_details, when an exception happens. If you add a render call in the rescue block this behavior should disappear.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •