Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 602777
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T16:51:31+00:00 2026-05-13T16:51:31+00:00

Rails, for example, has a defined set of patterns it uses to define ids

  • 0

Rails, for example, has a defined set of patterns it uses to define ids and other attributes in html, for example <input id="project[task_attributes][]" .../> is the result of something like <%= fields_for :task %> nested inside of <%= form_for :project %>. I’m sure other frameworks do the same.

This means that if you went to a random webpage and you saw that structure, via some regular expression magic, you could convert that html back to its template!

Has anybody ever tried to build anything like that? Do you think it’s even possible?

Update:

I myself am only interested in Ruby on Rails applications (not just the form as the above example shows, but everything on the html page), but if it were possible for everything, even better.

Once you generated the template HTML file (the ERB file in Rails), you could them manually go through and figure out the model and controller. You’d have to have the program compare all of the generated ERB files to figure out how to build the model and the controllers which might be an even bigger task. But that would be the end goal

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T16:51:32+00:00Added an answer on May 13, 2026 at 4:51 pm

    It is possible but it is a “massive task” of at least several man years.

    Given a HTML page with the forms:

    <form name=login>
        <input name=user></user>
        <input name=password></user>
    </form>
    
    <form name=add_comment>
        <input name=comment></user>
        <input name=your_id></user>
    </form>
    

    You would have code which does (psuedocode):

    erb = ""
    for each <form>
        for each <input>
            erb = erb + "<%=" + <input>.name + "%>"
    

    This is not the exact code, but psuedocode as I said. Anyway, then you would need to decide on how the submit button is processed for each form. Do you want this automatically generated as well in the Rails controller?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working on a Rails 2.1 project that has an ApplicationController similar to the
Rails has these cool properties that seem to be actually methods. For example: class
Let's say I have a nested resource like in the Rails guide example: http://guides.rubyonrails.org/routing.html#nested-resources
Trying out the example usage of codebrew rails-backbone , everything works fine but the
I have a rails server running on URL http://example.com:1234 I want to provide the
Rails noob here. I have a rails application with (in this example) three tables.
While learning Rails, I found this example in the Sam Ruby's book: app/controllers/line_items_controller.rb def
Does anyone have an example of setting up Authlogic with a namespace in Rails?
Can rails handle creating a view without a controller? For example, let say I
I'm trying to learn Rails better by looking at example applications, and while looking

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.