Tell me more ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I've been sent a bunch of .html files from a designer and I just want to use them directly, however they have non-resourceful links. I realise that if I map .html routes to home# actions, I can start working with his design without changing it.

I tried:

get ":page.html", to: "home#%{page}"

But it says there's no action %{page}. Is this doable with Rails routes in a single line? Or do I have to make a loop with all the page names?

Note: I'd like a solution without redirection

share|improve this question

1 Answer

up vote 1 down vote accepted

If you write something like

get ":action.html", controller: 'home'

or

get ":action.html", defaults: { controller: 'home' }

?

share|improve this answer
using :action as bound parameter name did it – nurettin 6 hours ago
ha, great because I just guessed it should work :D – Michael Szyndel 6 hours ago
probably thank you, then! – nurettin 5 hours ago

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.