0.0
No commit activity in last 3 years
No release in over 3 years
rudsl_rails helps organise your Rails views written in rudsl, through cards.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.7
~> 10.0

Runtime

>= 4.0
>= 1.0.1
 Project Readme

RudslRails

rudsl_rails makes it easier to use rudsl in your Rails project. The recommended organisation of your rudsl views are into cards that can be rendered directly, or as part of an non-rudsl view.

Installation

Add this line to your application's Gemfile:

gem 'rudsl_rails'

And then execute:

$ bundle

Usage

The gem provides a generator to help organise the cards. Run

rails generate rudsl_card users/profile

This will generate a new card in app/cards/users/ called profile_card.rb which can be used as follows:

render html: Users::ProfileCard.new(current_user).html

assuming, that the profile_card.rb looks as follows:

class Users:ProfileCard < RudslRails::Card
  attr_reader :user

  def initialize(user)
    @user = user
  end

  def node
    div class: 'profile-card' do
      h3 user.name
      img src: user.photo.url, class: 'responsive-image'
      p do
        user.bio
      end
    end
  end
end

Contributing

  1. Fork it ( https://github.com/sparkymat/rudsl_rails/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request