Giter Club home page Giter Club logo

Comments (4)

mihaic195 avatar mihaic195 commented on August 12, 2024 1

To reference routes inside the rapidfire engine from outside the engine you need to prepend the path with rapidfire. E.g. rapidfire.surveys_path

To reference routes outside the engine, from within the engine, you need to prepend your routes with main_app. E.g. main_app.some_other_path. (Or some other engine)

from rapidfire.

designium avatar designium commented on August 12, 2024

I have similar issue. Rapidfire cannot find any of other controller's routes and it keeps giving error that a route path is an undefined local variable or method not found.

from rapidfire.

ZacharyWeiner avatar ZacharyWeiner commented on August 12, 2024

I have a similar issue and it was solved by adding the initializer. But, after adding the initializer, and loading up the rapidfire root, clicking on "New Survey" leads me to a new error.


ActionView::Template::Error (undefined method `surveys_path' for #
<ActionDispatch::Routing::RoutesProxy:0x00007fa78701b1a8>):
    1: <h3><%= survey.new_record? ? "New Survey" : "Edit Survey" %></h3>
    2:
    3: <%= form_for survey do |f| %>
    4:   <%- if survey.errors.any? %>
    5:     <ul>
    6:       <%- survey.errors.full_messages.each do |message| %>

In this error, RapidFire cant find its own surveys path and the problem is surfaced from the Rapid Fire Initializer:

 main_app_route_methods.each do |m|
      define_method m do |*args|
        main_app.public_send(m, *args)
      end
      helper_method m
end

So, I was thinking that it's telling me that Im supposed to use the url_for helper in all the forms...
So I went into the views and updated the form to use the url_for

<%= form_for url_for(survey) do |f| %>

which worked to load the new survey page, but then on submission of the survey info I get:
No route matches [POST] "/rapidfire/surveys/new"

Which is true. In the rake routes list the :post route for new_survey_path is 'surveys/new' not rapidfire/surveys/new

Any help is appreciated.

from rapidfire.

stale avatar stale commented on August 12, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs for another 14 days. Thank you for your contributions.

from rapidfire.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.