Giter Club home page Giter Club logo

bem-on-rails's People

Contributors

artofhuman avatar awinogradov avatar gkopylov avatar

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  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  avatar  avatar

bem-on-rails's Issues

Block and Mods generated in different folders

When I run:

thor bem:create -b test

I get assets generated in the 'bem' folder:

  create  bem/myapp/test/test.html.haml
  create  bem/myapp/test/test.css.sass
  create  bem/myapp/test/test.coffee
  create  bem/myapp/test/test.md
  append  bem/myapp/.bem/assets/stylesheets/level.css.sass
  append  bem/myapp/.bem/assets/javascripts/level.js

But when I run:

thor bem:create -b test -m large

The assets are generated in the wrong folder 'mods':

  create  mods/myapp/test/mods/_large/_large.html.haml
  create  mods/myapp/test/mods/_large/_large.css.sass
  create  mods/myapp/test/mods/_large/_large.coffee
  create  mods/myapp/test/mods/_large/_large.md
  append  bem/myapp/.bem/assets/stylesheets/level.css.sass
  append  bem/myapp/.bem/assets/javascripts/level.js

The uncommented line in bem.rb is:

BEM[:level] = BEM[:app]

What am I doing wrong?

JS files are not been imported

I don't know if I forget some step but the application.js file isn't finding the Bem levels.js files. I'm pretty sure the path is right.

The Bem folder is on root.

I customise BEM[:assets]:

BEM[:levels] = [{:name => "landing"},{:name => "menu-start"},{:name => "dream-search"}]

BEM[:app] = Rails.application.class.to_s.split("::").first.underscore.split('_').map(&:downcase).join('-')
BEM[:levels].push({ name: BEM[:app] }) # levels stack
BEM[:level] = BEM[:app] # default level
# List of known techs.
BEM[:techs] = {
  haml: ".html.haml",
  slim: ".html.slim",
  erb: "html.erb",
  jade: ".jade",
  sass: ".css.sass",
  scss: ".css.scss",
  less: ".css.less",
  styl: ".css.styl",
  css: ".css",
  coffee: ".coffee",
  js: ".js",
  md: ".md",
  wiki: ".wiki"
}

BEM[:assets] = {
  stylesheets:
  {
    ext: BEM[:techs][:scss],
    import: '//= require'
  },
  javascripts:
  {
    ext: BEM[:techs][:js],
    import: '//= require'
  }
}

And that's my application.js:

//= require bem/dream-search/.bem/assets/javascripts/level.js
//= require bem/menu-start/.bem/assets/javascripts/level.js

//= require ../bem/dream-search/.bem/assets/javascripts/level.js
//= require ../bem/menu-start/.bem/assets/javascripts/level.js


//= require ../../bem/dream-search/.bem/assets/javascripts/level.js
//= require ../../bem/menu-start/.bem/assets/javascripts/level.js


//= require ../../../../bem/dream-search/.bem/assets/javascripts/level.js
//= require ../../../../bem/menu-start/.bem/assets/javascripts/level.js


//= require dream-search/.bem/assets/javascripts/level.js
//= require menu-start/.bem/assets/javascripts/level.js

Can anyone help me? I don't know what I'm missing.

Rendering a Block on a js.erb file

My blocks renders in 'html.erb' files, but aren't rendering in a 'js.erb'.

That's my code on the js.erb:

js $('#my-item').append( '<%= block "post-comment", comment: @comment %>' );

When I check on the browser this is file looks like this:

js $('#my-item').append( '' );

Since is rendering in "html.erb", shouldn't It render in all "*.erb" files?
There's some extra configuration to do?

Несовместимость с гемом awesome_print

Антон, посмотри пожалуйста, при установке bemonrails вместе с гемом awesome_print возникает ошибка uninitialized constant Bemonrails::BemRenderHelper.

Rails 4.0.0
ruby 2.0.0p247 (2013-06-27 revision 41674) [x86_64-darwin13.1.0]

Add bem-compatible html code generator

It would be awesome to avoid retyping bem-prefix every time while writing code in haml/rhtml template. I wonder one can add a preprocessor or something to convert

<%= block name: 'user' do %>
  <div>
    <p class="_name">
      <%= user.name %>
    </p>
    <p class="_age">
      <%= user.age %>
    </p>
  </div>
<% end %>

into

<div class=”b-user”>
  <p class="b-user_name">
     <%= user.name %>
  </p>
  <p class="b-user_age">
    <%= user.age %>
  </p>
</div>

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.