joseramonc / rails-snippets Goto Github PK
View Code? Open in Web Editor NEW:shipit:
Home Page: http://codn.mx/en
License: MIT License
:shipit:
Home Page: http://codn.mx/en
License: MIT License
Olá,
Os snippets ruby.rails e .ruby não estão funcionando!
ex: vs
(cmd+shift+.) - default erb tag now seems to produce <% %>
it used to produce <%= %>
when you rely on keybinding working the same way you tend not to look at it, after the latest update the functionality has changed, which can trip up users.
We have:
<%= f.text_field ... %>
new rails apps generate forms with form variable, we need to update snippets to keep up with new rails versions, but, add a stop for the "form" variable, something like this:
<%= ${form}.text_field ... %>
this change needs to be done for all form snippets
As rails community moves forwards, form_with will be the default in the future. add a snippet of this
.tap
tab should convert similar to a block, similar to .each
A few more snippets should be added to the ERB cycle. I think this is the order and availability in the original Sublime package:
<%= %>
<%= -%>
<%- -%>
<%- %>
<% %>
<%# %>
I especially miss having <%- -%>
available.
I can use snippets via alt+shift+s menu but i can't get it work by just pressing ctrl+shift+. I'm using Turkish Q Keyboard Layout maybe something related to this?
Thanks.
Usually I need another format, not json, add stops for this use case.
Use activationCommands
instead of activationEvents
in your package.json
Commands should be grouped by selector as follows:
"activationCommands": {
"atom-workspace": ["foo:bar", "foo:baz"],
"atom-text-editor": ["foo:quux"]
}
Package.getActivationCommands (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:808:9)
Package.hasActivationCommands (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:733:20)
<unknown> (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:187:24)
Package.measure (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:165:15)
Package.load (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:179:12)
PackageManager.loadPackage (/Applications/Atom.app/Contents/Resources/app.asar/src/package-manager.js:372:14)
Snippets/suggestions won't show up when Emmet is installed and activated. Anyone else dealt with this? works wonderfully with Emmet disabled though!
.each
trigger does not show up in erb files however it works in rb files even though it is an "embedded each".
Also if you have something like this @project.
you will get a list of triggers beginning with .
however if you type something afterwards @project.f
all the .
triggers disappear even the matching ones.
so.. what is going on?
Thanks :)
In an erb file, form_for + tab does not trigger the snippet
this two comands its don't work
Call ::getActiveTextEditor instead
Workspace.getActiveEditor (/opt/homebrew-cask/Caskroom/atom/latest/Atom.app/Contents/Resources/app/src/workspace.js:674:12)
Object.toggleErb (/Users/ryu-endo/.atom/packages/rails-snippets/lib/rails-snippets.coffee:19:28)
There are snippets that are specific to Ruby: def
, do
, class
. They already exist in language-ruby
package, sometimes they're conflicting. It would be a good idea to clean those up.
has_many_dependent produces: has_many :categories, dependent: destroy
it should be has_many :categories, dependent: :destroy
with the colon in front of destroy. http://guides.rubyonrails.org/association_basics.html
With rails-snippets package:
belongs_to
generate belongs_to :product, dependent: :destroy
With default Atom Ruby package
belongs_to
generate belongs_to :object, :class_name => "", :foreign_key => "reference_id"
I think rails-snippets should leave ruby snippets to default Atom package, and act only for html.erb snippets
12/151 of the snippets provided by rails-snippets start with period, e.g .each
. These snippets do not show correctly on the the autocomplete list. And if I reflexively tab/enter after typing .each
some other snippet (which does not have period) would get selected. As a quick workaround, I disable autocomplete-snippets. As a long-term solution, I filed an issue here: atom/autocomplete-snippets#67 . However, I am opening this issue here because either this anomaly needs to be documented here, or the snippets should be modified, and the periods removed.
Adjust it to match the ruby snippet.
Can not use form snippets, vpo, or any others.
See discussion here: https://discuss.atom.io/t/changing-a-files-meta-scope/16705/5
Main issue is that because the snippets are scoped to meta.rails.*
, it's not possible to use the snippets where the meta.rails.*
grammars/patterns aren't working.
Eg. It's not possible to use the scope
snippet in models that use inheritance as there is no < ActiveModel::Base
for the meta.rails.model
grammar to be applied.
Currently it triggers on every file, it must be supported only in .erb
views and other files like .yml
It would be great if everyone could modify or adjust the snippets to their hearts' content. Maybe add a config that would overwrite the default snippet :)
Thanks!
I think it would be a cool feature to also have support for the slim templating engine?
I would be willing to work on this if you think it's a valuable feature to have :)
Thanks!
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.