Skip to content

use rails helpers for resource routes#186

Closed
phoffer wants to merge 1 commit intohaml:masterfrom
phoffer:path_helpers
Closed

use rails helpers for resource routes#186
phoffer wants to merge 1 commit intohaml:masterfrom
phoffer:path_helpers

Conversation

@phoffer
Copy link

@phoffer phoffer commented Jan 9, 2023

I encountered some issues when using Rails scaffolding with a model name/namespace that didn't match up. Ie. scaffolding admin routes for some resources like this:

rails generate scaffold admin/user name:string --model-name="User"

This should generate everything using a User model, but with routing that follows admin_user* naming pattern. However, the templates would generate links with user* for paths.

This updates the templates to use the rest of the routing helpers Rails provides, and also includes a handler for the form target url, only if necessary.

@amatsuda
Copy link
Member

@phoffer haml-rails gem now generates haml templates that are completely HTML-equivalent to the Rails' original ERB templates (see #197).
So, could you try haml-rails 3.0.0 and check whether your problem is solved? If not, maybe we should fix Rails first. Thank you for your patch anyway!

@amatsuda amatsuda closed this Sep 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants