Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6676917
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T04:03:08+00:00 2026-05-26T04:03:08+00:00

My rails application is using js.erb views instead of html.erb views for specific windows.

  • 0

My rails application is using js.erb views instead of html.erb views for specific windows. This works fine in practice, but when I’m using cucumber tests with capybara it gives me an error of

Missing template admin/groups with {:handlers=>[:erb, :rjs, :builder, :rhtml, :rxml],    :formats=>[:html], :locale=>[:en, :en]} in view paths

When I click the button pertaining to this particular view. There is no groups.html.erb but there is a groups.js.erb. I want to somehow tell cucumber/capybara to not try to render the groups.html.erb but still render the groups.js.erb. I would prefer not to generate an unnecessary html file to render the same thing the escape javascript below is doing.

groups.js.erb:

$("#admin_content").html("<%= escape_javascript(render :partial => 'groups') %>");

Relevant admin controller method:

def groups
    @groups = Group.all
end
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T04:03:09+00:00Added an answer on May 26, 2026 at 4:03 am

    You should use proper MIME type handling for your responses. Try this:

    def groups
      @groups = Group.all
      respond_to do |format|
        format.js
      end
    end
    

    eventually you can be more specific about how to respond :

    format.js { render layout: false }
    

    more info on respond_to here.

    note: if your controller only manages js responses, you can add respond_to :js at the top of the class, and then use respond_with @object in your actions.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using application.html.erb in the views/layouts folder of my Ruby on Rails web app
I have a rails application using views/layouts/application.html.erb as the default site template. I'm just
I am currently deploying a Rails application using Capistrano. Cap deploy:update_code usually works just
I'm building a Rails application using MongoDB as the back-end and MongoMapper as the
I am currently developing a Rails application using a database that was designed before
says if i develop a Ruby on Rails application using Rails 2.3.2, will that
I am working on the billing component of a Ruby on Rails application using
I'm now redirecting to main page in my Rails application using redirect_to root_path I
I'm trying to make an API for my rails application using JSON responses to
We are writing a Rails application that is using CouchDB as its data store.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.