Comments (4)
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.
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.
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.
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)
- Rails 5.1: Directly inheriting from ActiveRecord::Migration is not supported HOT 1
- Rails 5.1: Index Creation fails HOT 3
- undefined local variable or method `rapidfire' for #<Rapidfire::QuestionsController:0x0....> HOT 1
- When using checkboxes, validation always fails HOT 6
- undefined method `before_filter' for Rapidfire::SurveysController:Class Did you mean? before_action HOT 2
- ActionController::UrlGenerationError in Rapidfire::Surveys#index HOT 1
- Bundler could not find compatible versions for gem "active_model_serializers" HOT 2
- One attempt for each user
- Links for Rapidfire redirect with bad link HOT 1
- Change `after_survey_content` to `thank_you` HOT 1
- Rename locales to include rapidfire prefix HOT 1
- answers_delimiter = "\r\n" HOT 3
- undefined method `page' for Survey:Module HOT 1
- Non logged in users not able to submit responses
- Acts_as_surveyable? HOT 2
- API support HOT 4
- after attempt redirect HOT 1
- Question text as a label HOT 1
- Feature Request: Images as part of the question HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rapidfire.