Skip to content
This repository has been archived by the owner on Feb 11, 2020. It is now read-only.

Add ability to define and load custom routes when prelaunch is enabled. #6

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jasherai
Copy link

Hi I've put an implementation together for #2 which is working for me. I'mm not very good with tests so I'm still working on that side of things but wanted to get your opinion on the methodology before I proceed.

Also I'm having problems running the cucumber tests in your project. Could you clarify which versions of cucumber and deps you are using for this project?

Thanks

By default we look for config/prelaunch_routes.rb but this can be
customised in config/prelaunch_config.yml with the custom_routes_file
key.

template generator gives example of using key in the
prelaunch_config.yml and an empty prelaunch_routes.rb is created for
reference.

By default we look for config/prelaunch_routes.rb but this can be
customised in config/prelaunch_config.yml with the custom_routes_file
key.

template generator gives example of using key in the
prelaunch_config.yml and an empty prelaunch_routes.rb is created for
reference.
@codealpha
Copy link

Hi,

I've created new controllers for a contact page I wanted to add to my pre-launch site, is there anyway to access this, as the specified routes no longer work.

You say something about prelaunch_routes.rb? How would I use this? What would an example route look like in this?

@jasherai
Copy link
Author

You create routes exactly as you would in your applications routes.rb. Your scenario is the same as mine, I also needed contact functionality.

The custom routes are evaluated after t-minus clear the original application routes, but before the t-minus routes ensuring the basic functionality works. Just copy your contact controller routes not the prelaunch_routes.rb.

I'll post an example in the morning if you wish?

@jasherai
Copy link
Author

Here is a copy of the prelaunch_routes.rb I'm using.

https://gist.github.com/1216352

@codealpha
Copy link

I've created the file in the config folder called prelaunch_routes.rb and it contains the following:

Rails.application.routes.draw do

get "contact_form/new"

get "contact_form/create"

resources :contact_forms

end

However, on using rake routes, the routes do not show up, and the routes are not working in the application either?

@jasherai
Copy link
Author

very odd... I assume you are using the feature/add_custom_routes branch of my repo in your Gemfile?

Could you give me the output of:
$ bundle exec rake routes --trace

Sorry about delays responding.. am looking after the better half after her op...

@codealpha
Copy link

How would I use that? I don't think I'm using it at the moment.
Aaah wish her well from me :)

@jasherai
Copy link
Author

Can you clarify? You aren't using bundler? How are you using this particular patch in your code? Just to be clear, my pull request hasn't been merged yet.

What errors/output are you seeing?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants