wasabigeek / railshelp Goto Github PK
View Code? Open in Web Editor NEWThe missing GUI for Rails generators
Home Page: https://wasabigeek.github.io/railshelp/
The missing GUI for Rails generators
Home Page: https://wasabigeek.github.io/railshelp/
Slightly ambitious, should be interesting. Rough approach:
Example generator classes:
We should be able to extract the argument
and class_options
and generate some generic components in React. There will be some that we want special logic (e.g. in [migrations](- https://github.com/rails/rails/blob/main/railties/lib/rails/generators/rails/migration/migration_generator.rb
) there is an argument: :attributes, type: :array...
which we could use to insert the AttributeArguments
component) but those can be edited manually.
There's also some intricacy to how some generators hook into others, which I haven't quite figured out yet e.g. there's a lot more logic relating to the model/migration's attributes. I'm guessing it invokes the ActiveRecord Model Generator)
Ideally break into smaller PRs. Some discussion can be found at #4 (comment) - the proposed is to have the individual FieldInput
s (could we rename to AttributeForm
?) do the validation and only call onUpdate
if the inputs are valid (sort of an uncontrolled component). I think we don't need to show an error in the command UI at this moment, just the form inputs.
We can follow https://tailwindui.com/components/application-ui/forms/input-groups#component-7a5297f99a5ed22df80939dd1986de5f, example HTML / classes:
<!--
This example requires Tailwind CSS v2.0+
This example requires some changes to your config:
// tailwind.config.js
module.exports = {
// ...
plugins: [
// ...
require('@tailwindcss/forms'),
]
}
-->
<div>
<label for="email" class="block text-sm font-medium text-gray-700">Email</label>
<div class="mt-1 relative rounded-md shadow-sm">
<input type="text" name="email" id="email" class="block w-full pr-10 border-red-300 text-red-900 placeholder-red-300 focus:outline-none focus:ring-red-500 focus:border-red-500 sm:text-sm rounded-md" placeholder="[email protected]" value="adamwathan" aria-invalid="true" aria-describedby="email-error">
<div class="absolute inset-y-0 right-0 pr-3 flex items-center pointer-events-none">
<!-- Heroicon name: solid/exclamation-circle -->
<svg class="h-5 w-5 text-red-500" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
<path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7 4a1 1 0 11-2 0 1 1 0 012 0zm-1-9a1 1 0 00-1 1v4a1 1 0 102 0V6a1 1 0 00-1-1z" clip-rule="evenodd" />
</svg>
</div>
</div>
<p class="mt-2 text-sm text-red-600" id="email-error">Your password must be less than 4 characters.</p>
</div>
type
is used for single table inheritanceUsers can generate and share URL on guiderails.
e.g. https://guiderails.wasabigeek.com/?gen=bin/rails|g|model|ExampleModel|other_model:references{polymorphic}:uniq
GUI loads with given data in URL
Like a playground for rails generator.
Currently, on refresh one will lose data.
Ability to save generators to local storage can help solve
The main README file contains a broken link to a file named USAGE which does not exist.
Dependency #7
https://rails.help provides wrong example:
bin/rails g model ExampleModel other_model:references{polymorphic}:uniq lng:decimal{10,6}
right example:
bin/rails g model ExampleModel other_model:references{polymorphic}:uniq lng:decimal{10-6}
Please change decimal{10,6}
to decimal{10-6}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.