Releases: Purple-Magic/tramway
0.4.9.2
0.4.9.1
Full Changelog: 0.4.9...0.4.9.1
0.4.9
Author:
Code review:
What's changed basically?
Added multiselect tailwind-styled input for tramway_form_for
What's changed for tramway drivers?
In case you want to use tailwind-styled multiselect this way
= tramway_form_for @user do |f|
= f.multiselect :permissions, [['Create User', 'create_user'], ['Update user', 'update_user']]
#- ...
you should add Tramway Multiselect Stimulus controller to your application.
Example for importmap-rails config
config/importmap.rb
pin '@tramway/multiselect', to: 'tramway/multiselect_controller.js'
app/javascript/controllers/index.js
import { application } from "controllers/application"
import { eagerLoadControllersFrom } from "@hotwired/stimulus-loading"
import { Multiselect } from "@tramway/multiselect" // importing Multiselect controller class
eagerLoadControllersFrom("controllers", application)
application.register('multiselect', Multiselect) // register Multiselect controller class as `multiselect` stimulus controller
What's Changed
- Multiselect: Tailwind-styled Stimulus-based by @kalashnikovisme in #71
Full Changelog: 0.4.8...0.4.9
0.4.8
Author:
What's changed basically?
tramway_decorate
method is available inside Tramway Decorator class
What's changed for tramway drivers?
Before
class UserDecorator < Tramway::BaseDecorator
def published_posts
PostDecorator.decorate object.posts.published
end
end
After
class UserDecorator < Tramway::BaseDecorator
def published_posts
tramway_decorate object.posts.published
end
end
- Add rubocop-rails and rubocop-rspec by @kalashnikovisme in #67
- Issue #69. Add tramway_decorate method to tramway_form by @kalashnikovisme in #70
Full Changelog: 0.4.7...0.4.8
0.4.7
What's changed basically?
Added assign
method to Tramway Form.
What's changed for tramway drivers?
Tramway Form provides assign
method that allows to assign values without saving
class UsersController < ApplicationController
def update
@user = tramway_form User.new
@user.assign params[:user] # assigns values to the form object
@user.reload # restores previous values
end
end
What's Changed
- Add assign method to Tramway Form by @kalashnikovisme in #65
Full Changelog: 0.4.6...0.4.7
0.4.6
Author:
Code-review:
What's changed basically?
- Decorating association using Tramway Decorator
What's changed for tramway drivers?
Decorate associations
Before
class UserDecorator < Tramway::BaseDecorator
def posts
PostDecorator.decorate object.posts
end
end
After
class UserDecorator < Tramway::BaseDecorator
association :posts
end
user = tramway_decorate User.first
user.posts # => decorated collection of posts with PostDecorator
What's Changed
- Delegate association by @kalashnikovisme in #63
Full Changelog: 0.4.5.1...0.4.6
0.4.5.1
0.4.5
What's Changed
- Label, select and navbar fixes by @kalashnikovisme in #60
Full Changelog: 0.4.4...0.4.5
0.4.4
Author:
What's changed basically?
- Changed method delegation policy.
- Added
behave_as_ar
method from this issue
What's changed for tramway drivers?
Tramway Decorator and Tramway Form support behave_as_ar
method. It allows to use update
and destroy
methods with decorated and form objects.
What's Changed
- Changing method delegation policy by @kalashnikovisme in #58
Full Changelog: 0.4.3...0.4.4
0.4.3
Author:
Code-review:
What's changed basically?
Delegated update
and destroy
methods to Tramway Decorator.
What's changed for tramway drivers?
Before
user = tramway_decorate User.first
user.object.destroy
After
user = tramway_decorate User.first
user.destroy
What's Changed
- Issue #51. Delegate update and destroy methods to Tramway Decorator by @kalashnikovisme in #52
Full Changelog: 0.4.2.1...0.4.3