Code Monkey home page Code Monkey logo

rails-snippets's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

rails-snippets's Issues

default erb tag

(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.

Change form default "form" variable

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

Add form_with snippet

As rails community moves forwards, form_with will be the default in the future. add a snippet of this

Better ERB Snippets

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.

Snippet shorcut keys doesn't work

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.

Package.getActivationCommands is deprecated.

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)

Issues with Emmet in Atom

Snippets/suggestions won't show up when Emmet is installed and activated. Anyone else dealt with this? works wonderfully with Emmet disabled though!

`.each` is missing from embedded ruby files

.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 :)

Workspace.getActiveEditor is deprecated.

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)

Remove Ruby-specific snippets

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.

belongs_to worse than default Atom snippet

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

Snippets with periods do not play well with autocomplete-plus

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.

Incompatibility with ruby-language package

If I install rails-snippets package, the else behaves like elseif, in a .rb file (controller or model)

when typing else:
image

and when you press enter, or choose with mouse "else":
image

It happens in aif - else or in a when
If you want a else, and not elseif true, you have to delte back

Support for Slim Templating Engine

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!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.