{"id":22595005,"url":"https://github.com/langalex/forms-fu","last_synced_at":"2025-04-11T00:14:27.191Z","repository":{"id":391080,"uuid":"8715","full_name":"langalex/forms-fu","owner":"langalex","description":"enhanced form handling for rails applications","archived":false,"fork":false,"pushed_at":"2008-07-15T16:36:58.000Z","size":80,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-11T00:14:22.152Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://upstream-berlin.com/blog/open-source/#forms_fu","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/langalex.png","metadata":{"files":{"readme":"README","changelog":null,"contributing":null,"funding":null,"license":"MIT-LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2008-04-11T13:08:41.000Z","updated_at":"2019-08-13T13:22:51.000Z","dependencies_parsed_at":"2022-08-16T10:25:05.728Z","dependency_job_id":null,"html_url":"https://github.com/langalex/forms-fu","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/langalex%2Fforms-fu","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/langalex%2Fforms-fu/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/langalex%2Fforms-fu/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/langalex%2Fforms-fu/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/langalex","download_url":"https://codeload.github.com/langalex/forms-fu/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248317730,"owners_count":21083530,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-08T10:08:27.636Z","updated_at":"2025-04-11T00:14:27.169Z","avatar_url":"https://github.com/langalex.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"forms-fu\n======================\n\nthis plugin is intended to help in creating forms. its featureset will grow in the near future. for now it can do this:\n\n* adds a required_field?(field_name) method to all the activerecord models. this allows you to automatically mark required fields in a form with a *. required fields are determined automatically from the validates_* calls in the class.\n\n* there is a helper method available in the views that prints out the label for a field with our without star\n\n* a TabularForumBuilder class which can be used with the form_for rails helper. It automatically wraps all form fields in table rows and cells.\n\n\nExamples\n=======\n\n# user.rb\n\nclass User \u003c ActiveRecord::Base\n  validates_presence_of :name\n  validates_confirmation_of :password\n  validates_acceptance_of :terms\n  \n  required_fields \u003c\u003c [:login] # in case you want to mark additional fields as required\nend\n\nUser.required_field?(:name) # =\u003e true\nUser.required_field?(:login) # =\u003e true\nUser.required_field?(:password_confirmation) # =\u003e true\nUser.required_field?(:terms) # =\u003e true\nUser.required_field?(:email) # =\u003e false\n\n\n# users/new.html.erb\n\n\u003c%= label_fu @user, :name %\u003e # =\u003e \u003clabel for=\"user_name\"\u003eName *\u003c/label\u003e\n\u003c%= label_fu @user, :email %\u003e # =\u003e \u003clabel for=\"user_email\"\u003eEmail\u003c/label\u003e\n\n# or with the form builder\n\n\u003c%- form_for :user, :builder =\u003e TabularFormBuilder do |f| -%\u003e\n  \u003ctable\u003e\n  \u003c%= f.text_field :name %\u003e\n  \u003c/table\u003e\n\u003c%- end -%\u003e\n\n# prints out:\n\n\u003cform ...\u003e\n  \u003ctable\u003e\n    \u003ctr\u003e\n      \u003cth\u003e\u003clabel for=\"user_name\"\u003eName: *\u003c/label\u003e\u003c/th\u003e\n      \u003ctd\u003e\u003cinput name=\"user[name]\" type=\"text\"/\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n  \u003c/table\u003e\n\u003c/form\u003e\n\n# some added sugar:\n\n\u003c%= f.text_fields :email, :name, :address %\u003e\n\n# call text_field for each of the attributes\n\n\u003c%= f.text_field_without_label :name %\u003e\n\n# prints out the input tag without the tr, td and label - in case you need more customization\n\nFor questions, patches etc. contact alex[at]upstream-berlin.com\n\nCopyright (c) 2008 Alexander Lang, released under the MIT license\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flangalex%2Fforms-fu","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flangalex%2Fforms-fu","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flangalex%2Fforms-fu/lists"}