Git Product home page Git Product logo

trestle'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  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  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

trestle's Issues

disable row clickability

is it possible to disable full row clickability on index view?

i have implemented custom tooltips on click and i need to show only tooltip instead of redirect to show\edit view

thanks

Why is bower_components on git?

Hi,
I've started using Trestle recently for my rails apps and it is awesome! The code is clean and easy to read and extend.
Also, I liked the way you manage assets with a rails engine (I'm following this style for my engines now), but I am a bit confused about vendor/assets/bower_components folder: why is this folder on git? This is not a dependency folder (just like .bundle folder) and shouldn't be ignored by git?

Translate and pluralize by default locale

I think it would be a good idea to use the translation of the models (if available) by default, for the menu and titles of each resource. Because pluralization only works well with English words.

Example, the plural of the word "Perfil" should be "Profis", but it will look like "Perfils". If this is implemented, the translations and pluralizations would be done by default, getting the translations correctly.

Shouldn't permitted_params run controller context?

Why permitted_params runs on adapter context? From the context of a model, all parameters is always permitted, the validation of params only have meaning if running on controller context (thats why protected_attributes/strong_parameters gems moved from active_record to action_controller).
In the current codebase, it's impossible to validate params base on current user, for example:

# app/admin/users_admin.rb
params do |params|
  if current_user.admin?
    [:all, :user, :attrs, :is, :permitted]
  elsif current_user.id == instance.id
    [:password, :password_confirmation]
  else
    []
  end
end

The code above rises an error because it is an "instance_exec" on Admin class and doesn't have access to current_user neither instance.

Compatability issues with friendly_id gem

I'm using the popular FriendlyId gem in conjunction with Trestle but there seems to be an issue with the way that it handles finding models.

FriendlyId gem rewrites the to_param method to use a slug rather than an ID. This part is working fine in the dashboard: I can see that the data-url attribute of a row is set to, for example, /admin/people/joe-czucha rather than /admin/people/1.

However, clicking a row gives the following error:

Couldn't find Person with 'id'=joe-czucha

From the FriendlyId documentation, I found the following:

Finders are no longer overridden by default. If you want to do friendly finds, you must do Model.friendly.find rather than Model.find.

So it looks like the error is because Trestle is using Model.find (rather than the new Model.friendly.find). I was wondering whether it's worth including a configuration option to allow one to specify a customised model finder method? I appreciate that this might be an edge case, but if there is one gem that does this then there are bound to be others.

The other possible solution, also from the FriendlyID docs:

You can however restore FriendlyId 4-style finders by using the :finders

This means that Model.find will continue to work and, in theory, Trestle should be able to handle it out-of-the-box. Unfortunately this addon doesn't actually seem to be working for me at the moment so I've not been able to test it properly.

Thanks again for your work on Trestle, it really is awesome.

Steps to reproduce:

  1. Create a (working) Trestle project

     rails new friendlytrestle && cd friendlytrestle
     rails g model Person name:string slug:string:uniq
     rake db:migrate
    
     gem 'trestle' (-> Gemfile)
     bundle
    
     rails generate trestle:install
     rails generate trestle:resource Person
    
     http://localhost:3000/admin
    
  2. Add a person using Trestle. You can view them using http://localhost:3000/admin/people/1

  3. Install FriendlyId

     gem 'friendly_id', '~> 5.1.0' (-> Gemfile)
     bundle
    
     rails g friendly_id
     rake db:migrate
    
  4. Add to Person model

     include FriendlyId
     friendly_id :title, :use => :slugged
    
  5. Add another person (or resave the first). Links in Trestle point to http://localhost:3000/admin/people/person-name but you get the above error.

Trouble with additing search and auth plugins

Hi!On my project, i have auth plugin in use, then i tried to connect search plugin, but, i've got error on any admin page:
screenshot from 2017-08-21 18 15 32

Gemfile code:

source 'https://rubygems.org'

git_source(:github) do |repo_name|
  repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/")
  "https://github.com/#{repo_name}.git"
end


# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 5.1.2'
# Use postgresql as the database for Active Record
gem 'pg', '~> 0.18'
# Use Puma as the app server
gem 'jquery-rails'
gem 'puma', '~> 3.7'
gem 'simple_command'
gem 'trestle-tinymce'
gem 'trestle-search'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# See https://github.com/rails/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby

# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.2'
gem 'devise'
gem 'slim-rails'
gem 'trestle-auth'
# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks
gem 'turbolinks', '~> 5'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.5'
# Use Redis adapter to run Action Cable in production
# gem 'redis', '~> 3.0'
# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'

# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development
gem 'trestle'
group :development, :test do
  # Call 'byebug' anywhere in the code to stop execution and get a debugger console
  gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
  # Adds support for Capybara system testing and selenium driver
  gem 'capybara', '~> 2.13'
  gem 'selenium-webdriver'
  gem 'byebug', platform: :mri
  gem 'bullet'
  gem 'rspec-rails', '~> 3.5'
  gem 'rails-controller-testing'
  gem 'factory_girl_rails'
  gem 'shoulda-matchers', '~> 3.0'
  gem 'shoulda-callback-matchers', '~> 1.1.1'
  gem 'database_cleaner'
  gem 'pry'
  gem 'simplecov', require: false
end

group :development do
  # Access an IRB console on exception pages or by using <%= console %> anywhere in the code.
  gem 'web-console', '>= 3.3.0'
  gem 'listen', '>= 3.0.5', '< 3.2'
  # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
  gem 'spring'
  gem 'spring-watcher-listen', '~> 2.0.0'
end

# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]

tabs inside tabs

i would like to render something like this

form do |instance|
  tab '1' do
    tab '1.1' do
      'content 1.1'
    end
    tab '1.2' do
      'content 1.2'
    end
  end
  tab '2' do
  end
end

but receive one flat tab nav panel ( 1 | 1.1 | 1.2 | 2 ). is this a bug or nested tabs are not supported\can not be implemented?

Allow configuration of datepicker firstDayOfWeek in Trestle initializer

I have placed Flatpickr.l10ns.default.firstDayOfWeek = 1; in a <script> tag in the document's head, and set config.i18n.default_locale = :'en-GB' in config/initializers/application.rb, but the generated datepickers are still incorrectly showing with the week running from Sunday to Saturday, rather than from Monday to Sunday.

It would be useful if there was a config option to set the first day of the week in the Trestle initializer.

In the meantime, could somebody please tell me how to configure Trestle to display the datepicker correctly for my locale? I can't put the site out with it like this — I will get a load of complaints…

Best approach for nested models?

I have a few nested resources (including a hierarchy of the same model) and I was wondering what the best approach for handling this is.

Currently I am overriding large parts of the controller to redirect to to the right place after certain actions (like delete, for instance) and to insert the parent record into the breadcrumb trail.

Here's an example:

# Activities Admin
  controller do
    def index
      # shouldn't get here because the index listing is part of the parent record admin
      redirect_to Trestle.admins['programs'].path
    end

    def destroy
      instance = admin.find_instance(params)
     # save the parent so we can redirect there instead of the index for this resource
      program = instance.program
      success = admin.delete_instance(instance)
      respond_to do |format|
        format.html do
          if success
            flash[:message] = flash_message("success.destroy", default: "The %{model_name} was successfully deleted.")
           # here's the custom redirect
            redirect_to program_activities_path(program)
          else
            flash[:error] = flash_message("failure.destroy", default: "Could not delete %{model_name}.")
            redirect_to admin.path(:edit, id: instance)
          end
        end
        format.json { head :no_content }
        format.js
      end
    end

    def breadcrumbs
      @breadcrumbs ||= Trestle::Breadcrumb::Trail.new(Trestle.config.root_breadcrumbs).tap do |trail|
        # insert the parent program
        if instance.try(:program)
          trail.append(
            instance.program.name,
            program_activities_path(instance.program)
            )
        end

        # and the parent model, for single model hierarchies
        if instance.parent
          trail.append(
            instance.parent.name,
            activity_path(instance.parent)
            )
        end
      end
    end

    # helper methods to get paths for other resources
    def activity_path(activity)
      Trestle.admins['activities'].path(:show, id: activity)
    end

    def program_activities_path(program)
      Trestle.admins['programs'].path(:show, id: program, anchor: '!tab-activities')
    end
end

I'm doing something similar in a few places and was wondering if there's a better way I'm missing, or if this isn't really handled properly yet.

Thanks!

Redirect after create. Remove edit and update actions

Hi there
First of all thanks a lot for your work. It works good and looks beauty.

Can I somehow change redirect path after create? (want change it to index action)
Also I want remove ability to edit and update record?

I found readonly: true mode, but I want to keep [:new, :create, :delete] actions

version of included jquery brakes (at least) included bootstrap's modals

there are 3.2.1 version of jquery and 3.3.7 version of bootstrap...

according to this https://stackoverflow.com/questions/37738732/jquery-3-0-url-indexof-error

if i change here vendor/assets/bower_components/trestle/bootstrap-sass/assets/javascripts/bootstrap.js:946
and here
vendor/assets/bower_components/trestle/bootstrap-sass/assets/javascripts/bootstrap/modal.js:30

this

.load(this.options.remote, $.proxy(function () {

to this

.on('load', this.options.remote, $.proxy(function () {

my bootstrap modal work like expected

maybe this problem is bigger in other aspects of jquery 3.0 vs bootstrap, so it is possibly need to be reviewed more deeply

Trestle options merge stack level too deep on Rails master

Hi,

Not sure if an issue since I'm trying some crazy stuff. I'm using rails/rails@603475b to try out ActiveStorage. When navigating to Trestle, the app crashes with the following stack trace:

DEPRECATION WARNING: ActionView::Template::Handlers::Erubis is deprecated and will be removed from Rails 5.2. Switch to ActionView::Template::Handlers::ERB::Erubi instead. (called from require at /Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/skylight-1.3.1/lib/skylight/probes.rb:81) �[1m�[36mActivity Load (19.4ms)�[0m �[1m�[34mSELECT "activities".* FROM "activities" ORDER BY "activities"."id" ASC LIMIT $1�[0m [["LIMIT", 1000]] Started GET "/admin/active_storage/attachments" for 127.0.0.1 at 2017-09-12 23:05:26 +0200 �[1m�[35m (2.6ms)�[0m �[1m�[34mSELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC�[0m Processing by ActiveStorage::AttachmentsAdmin::AdminController#index as HTML Rendering /Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/trestle-0.8.4/app/views/layouts/trestle/admin.html.erb Rendering /Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/trestle-0.8.4/app/views/trestle/resource/index.html.erb within layouts/trestle/admin Rendered /Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/trestle-0.8.4/app/views/trestle/application/_header.html.erb (2.9ms) Rendered /Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/trestle-0.8.4/app/views/trestle/application/_flash.html.erb (1.2ms) Rendered /Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/trestle-0.8.4/app/views/trestle/application/_utilities.html.erb (0.5ms) Rendered /Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/trestle-0.8.4/app/views/trestle/application/_tabs.html.erb (0.5ms) �[1m�[36mActiveStorage::Attachment Load (0.8ms)�[0m �[1m�[34mSELECT "active_storage_attachments".* FROM "active_storage_attachments" LIMIT $1 OFFSET $2�[0m [["LIMIT", 25], ["OFFSET", 0]] Rendered /Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/trestle-0.8.4/app/views/trestle/table/_table.html.erb (37.7ms) Rendered /Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/trestle-0.8.4/app/views/trestle/resource/_table.html.erb (46.0ms) Rendered /Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/trestle-0.8.4/app/views/trestle/application/_layout.html.erb (231.8ms) Rendered /Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/trestle-0.8.4/app/views/trestle/resource/index.html.erb within layouts/trestle/admin (279.9ms) Rendered /Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/trestle-0.8.4/app/views/layouts/trestle/admin.html.erb (284.7ms) Completed 500 Internal Server Error in 331ms (ActiveRecord: 7.1ms)

SystemStackError (stack level too deep):

------- The line below is repeated 1 million times -------
/Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/activesupport/lib/active_support/core_ext/hash/deep_merge.rb:24:in deep_merge!' trestle (0.8.4) lib/trestle/options.rb:12:in merge!'
/Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/activesupport/lib/active_support/core_ext/hash/deep_merge.rb:24:in deep_merge!' trestle (0.8.4) lib/trestle/options.rb:12:in merge!'
/Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/activesupport/lib/active_support/core_ext/hash/deep_merge.rb:24:in deep_merge!' trestle (0.8.4) lib/trestle/options.rb:12:in merge!'
trestle (0.8.4) lib/trestle/table/row.rb:24:in options' trestle (0.8.4) app/views/trestle/table/_table.html.erb:15:in block (2 levels) in ___sers_richard__rbenv_versions_______lib_ruby_gems_______gems_trestle_______app_views_trestle_table__table_html_erb___2281924662489470806_70341304627600'
/Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/activerecord/lib/active_record/relation/delegation.rb:41:in each' /Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/activerecord/lib/active_record/relation/delegation.rb:41:in each'
trestle (0.8.4) app/views/trestle/table/_table.html.erb:14:in block in ___sers_richard__rbenv_versions_______lib_ruby_gems_______gems_trestle_______app_views_trestle_table__table_html_erb___2281924662489470806_70341304627600' /Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/actionview/lib/action_view/helpers/capture_helper.rb:41:in block in capture'
/Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/actionview/lib/action_view/helpers/capture_helper.rb:205:in with_output_buffer' brakeman (3.7.2) bundle/ruby/2.3.0/gems/haml-4.0.7/lib/haml/helpers/action_view_xss_mods.rb:5:in with_output_buffer_with_haml_xss'
/Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/actionview/lib/action_view/helpers/capture_helper.rb:41:in capture' brakeman (3.7.2) bundle/ruby/2.3.0/gems/haml-4.0.7/lib/haml/helpers/action_view_mods.rb:52:in capture_with_haml'
/Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/actionview/lib/action_view/helpers/tag_helper.rb:272:in content_tag' brakeman (3.7.2) bundle/ruby/2.3.0/gems/haml-4.0.7/lib/haml/helpers/action_view_mods.rb:61:in content_tag_with_haml'
trestle (0.8.4) app/views/trestle/table/_table.html.erb:4:in ___sers_richard__rbenv_versions_______lib_ruby_gems_______gems_trestle_______app_views_trestle_table__table_html_erb___2281924662489470806_70341304627600' /Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/actionview/lib/action_view/template.rb:159:in block in render'
/Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/activesupport/lib/active_support/notifications.rb:170:in instrument' /Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/actionview/lib/action_view/template.rb:354:in instrument_render_template'
/Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/actionview/lib/action_view/template.rb:157:in render' /Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/actionview/lib/action_view/renderer/partial_renderer.rb:344:in block in render_partial'
/Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/actionview/lib/action_view/renderer/abstract_renderer.rb:44:in block in instrument' /Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/activesupport/lib/active_support/notifications.rb:168:in block in instrument'
/Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/activesupport/lib/active_support/notifications/instrumenter.rb:23:in instrument' /Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/activesupport/lib/active_support/notifications.rb:168:in instrument'
/Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/actionview/lib/action_view/renderer/abstract_renderer.rb:43:in instrument' /Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/actionview/lib/action_view/renderer/partial_renderer.rb:333:in render_partial'
/Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/actionview/lib/action_view/renderer/partial_renderer.rb:312:in render' /Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/actionview/lib/action_view/renderer/renderer.rb:49:in render_partial'
/Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/actionview/lib/action_view/helpers/rendering_helper.rb:37:in render' brakeman (3.7.2) bundle/ruby/2.3.0/gems/haml-4.0.7/lib/haml/helpers/action_view_mods.rb:12:in render_with_haml'
trestle (0.8.4) app/views/trestle/resource/_table.html.erb:1:in ___sers_richard__rbenv_versions_______lib_ruby_gems_______gems_trestle_______app_views_trestle_resource__table_html_erb__2971056219610790013_70341304723280' /Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/actionview/lib/action_view/template.rb:159:in block in render'
/Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/activesupport/lib/active_support/notifications.rb:170:in instrument' /Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/actionview/lib/action_view/template.rb:354:in instrument_render_template'
/Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/actionview/lib/action_view/template.rb:157:in render' /Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/actionview/lib/action_view/renderer/partial_renderer.rb:344:in block in render_partial'
/Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/actionview/lib/action_view/renderer/abstract_renderer.rb:44:in block in instrument' /Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/activesupport/lib/active_support/notifications.rb:168:in block in instrument'
/Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/activesupport/lib/active_support/notifications/instrumenter.rb:23:in instrument' /Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/activesupport/lib/active_support/notifications.rb:168:in instrument'
/Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/actionview/lib/action_view/renderer/abstract_renderer.rb:43:in instrument' /Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/actionview/lib/action_view/renderer/partial_renderer.rb:333:in render_partial'
/Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/actionview/lib/action_view/renderer/partial_renderer.rb:312:in render' /Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/actionview/lib/action_view/renderer/renderer.rb:49:in render_partial'
/Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/actionview/lib/action_view/helpers/rendering_helper.rb:37:in render' brakeman (3.7.2) bundle/ruby/2.3.0/gems/haml-4.0.7/lib/haml/helpers/action_view_mods.rb:12:in render_with_haml'
trestle (0.8.4) app/views/trestle/resource/index.html.erb:12:in block in ___sers_richard__rbenv_versions_______lib_ruby_gems_______gems_trestle_______app_views_trestle_resource_index_html_erb___4093380367574730845_70341348904040' /Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/actionview/lib/action_view/helpers/capture_helper.rb:41:in block in capture'
/Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/actionview/lib/action_view/helpers/capture_helper.rb:205:in with_output_buffer' brakeman (3.7.2) bundle/ruby/2.3.0/gems/haml-4.0.7/lib/haml/helpers/action_view_xss_mods.rb:5:in with_output_buffer_with_haml_xss'
/Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/actionview/lib/action_view/helpers/capture_helper.rb:41:in capture' brakeman (3.7.2) bundle/ruby/2.3.0/gems/haml-4.0.7/lib/haml/helpers/action_view_mods.rb:52:in capture_with_haml'
/Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/actionview/lib/action_view/helpers/rendering_helper.rb:93:in _layout_for' /Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/actionview/lib/action_view/renderer/partial_renderer.rb:345:in block (2 levels) in render_partial'
trestle (0.8.4) app/views/trestle/application/_layout.html.erb:10:in block in ___sers_richard__rbenv_versions_______lib_ruby_gems_______gems_trestle_______app_views_trestle_application__layout_html_erb___2790920650924912972_70341347449500' /Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/actionview/lib/action_view/helpers/capture_helper.rb:41:in block in capture'
/Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/actionview/lib/action_view/helpers/capture_helper.rb:205:in with_output_buffer' brakeman (3.7.2) bundle/ruby/2.3.0/gems/haml-4.0.7/lib/haml/helpers/action_view_xss_mods.rb:5:in with_output_buffer_with_haml_xss'
/Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/actionview/lib/action_view/helpers/capture_helper.rb:41:in capture' brakeman (3.7.2) bundle/ruby/2.3.0/gems/haml-4.0.7/lib/haml/helpers/action_view_mods.rb:52:in capture_with_haml'
trestle (0.8.4) app/helpers/trestle/container_helper.rb:5:in container' trestle (0.8.4) app/views/trestle/application/_layout.html.erb:9:in ___sers_richard__rbenv_versions_______lib_ruby_gems_______gems_trestle_______app_views_trestle_application__layout_html_erb___2790920650924912972_70341347449500'
/Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/actionview/lib/action_view/template.rb:159:in block in render' /Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/activesupport/lib/active_support/notifications.rb:170:in instrument'
/Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/actionview/lib/action_view/template.rb:354:in instrument_render_template' /Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/actionview/lib/action_view/template.rb:157:in render'
/Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/actionview/lib/action_view/renderer/partial_renderer.rb:344:in block in render_partial' /Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/actionview/lib/action_view/renderer/abstract_renderer.rb:44:in block in instrument'
/Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/activesupport/lib/active_support/notifications.rb:168:in block in instrument' /Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/activesupport/lib/active_support/notifications/instrumenter.rb:23:in instrument'
/Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/activesupport/lib/active_support/notifications.rb:168:in instrument' /Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/actionview/lib/action_view/renderer/abstract_renderer.rb:43:in instrument'
/Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/actionview/lib/action_view/renderer/partial_renderer.rb:333:in render_partial' /Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/actionview/lib/action_view/renderer/partial_renderer.rb:312:in render'
/Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/actionview/lib/action_view/renderer/renderer.rb:49:in render_partial' /Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/actionview/lib/action_view/helpers/rendering_helper.rb:32:in render'
brakeman (3.7.2) bundle/ruby/2.3.0/gems/haml-4.0.7/lib/haml/helpers/action_view_mods.rb:12:in render_with_haml' trestle (0.8.4) app/views/trestle/resource/index.html.erb:11:in ___sers_richard__rbenv_versions_______lib_ruby_gems_______gems_trestle_______app_views_trestle_resource_index_html_erb___4093380367574730845_70341348904040'
/Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/actionview/lib/action_view/template.rb:159:in block in render' /Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/activesupport/lib/active_support/notifications.rb:170:in instrument'
/Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/actionview/lib/action_view/template.rb:354:in instrument_render_template' /Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/actionview/lib/action_view/template.rb:157:in render'
/Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/actionview/lib/action_view/renderer/template_renderer.rb:54:in block (2 levels) in render_template' /Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/actionview/lib/action_view/renderer/abstract_renderer.rb:44:in block in instrument'
/Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/activesupport/lib/active_support/notifications.rb:168:in block in instrument' /Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/activesupport/lib/active_support/notifications/instrumenter.rb:23:in instrument'
/Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/activesupport/lib/active_support/notifications.rb:168:in instrument' /Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/actionview/lib/action_view/renderer/abstract_renderer.rb:43:in instrument'
/Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/actionview/lib/action_view/renderer/template_renderer.rb:53:in block in render_template' /Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/actionview/lib/action_view/renderer/template_renderer.rb:61:in render_with_layout'
skylight (1.3.1) lib/skylight/probes/action_view.rb:32:in block in render_with_layout' /Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/actionview/lib/action_view/renderer/abstract_renderer.rb:44:in block in instrument'
/Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/activesupport/lib/active_support/notifications.rb:168:in block in instrument' /Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/activesupport/lib/active_support/notifications/instrumenter.rb:23:in instrument'
/Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/activesupport/lib/active_support/notifications.rb:168:in instrument' /Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/actionview/lib/action_view/renderer/abstract_renderer.rb:43:in instrument'
skylight (1.3.1) lib/skylight/probes/action_view.rb:31:in render_with_layout' /Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/actionview/lib/action_view/renderer/template_renderer.rb:52:in render_template'
/Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/actionview/lib/action_view/renderer/template_renderer.rb:16:in render' /Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/actionview/lib/action_view/renderer/renderer.rb:44:in render_template'
/Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/actionview/lib/action_view/renderer/renderer.rb:25:in render' /Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/actionview/lib/action_view/rendering.rb:105:in _render_template'
/Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/actionpack/lib/action_controller/metal/streaming.rb:219:in _render_template' /Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/actionview/lib/action_view/rendering.rb:85:in render_to_body'
/Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/actionpack/lib/action_controller/metal/rendering.rb:52:in render_to_body' /Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/actionpack/lib/action_controller/metal/renderers.rb:142:in render_to_body'
/Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/actionpack/lib/abstract_controller/rendering.rb:26:in render' /Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/actionpack/lib/action_controller/metal/rendering.rb:36:in render'
/Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/actionpack/lib/action_controller/metal/instrumentation.rb:46:in block (2 levels) in render' /Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/activesupport/lib/active_support/core_ext/benchmark.rb:14:in block in ms'
/Users/richard/.rbenv/versions/2.4.1/lib/ruby/2.4.0/benchmark.rb:308:in realtime' /Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/activesupport/lib/active_support/core_ext/benchmark.rb:14:in ms'
/Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/actionpack/lib/action_controller/metal/instrumentation.rb:46:in block in render' /Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/actionpack/lib/action_controller/metal/instrumentation.rb:89:in cleanup_view_runtime'
/Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/activerecord/lib/active_record/railties/controller_runtime.rb:31:in cleanup_view_runtime' /Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/actionpack/lib/action_controller/metal/instrumentation.rb:45:in render'
remotipart (1.3.1) lib/remotipart/render_overrides.rb:16:in render_with_remotipart' /Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/actionpack/lib/action_controller/metal/implicit_render.rb:35:in default_render'
/Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/actionpack/lib/action_controller/metal/basic_implicit_render.rb:6:in block in send_action' /Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/actionpack/lib/action_controller/metal/basic_implicit_render.rb:6:in tap'
/Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/actionpack/lib/action_controller/metal/basic_implicit_render.rb:6:in send_action' /Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/actionpack/lib/abstract_controller/base.rb:196:in process_action'
/Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/actionpack/lib/action_controller/metal/rendering.rb:30:in process_action' /Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/actionpack/lib/abstract_controller/callbacks.rb:42:in block in process_action'
/Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/activesupport/lib/active_support/callbacks.rb:109:in block in run_callbacks' react-rails (2.2.1) lib/react/rails/controller_lifecycle.rb:31:in use_react_component_helper'
/Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/activesupport/lib/active_support/callbacks.rb:118:in block in run_callbacks' route_translator (5.5.0) lib/route_translator/extensions/action_controller.rb:23:in set_locale_from_url'
/Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/activesupport/lib/active_support/callbacks.rb:118:in block in run_callbacks' /Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/activesupport/lib/active_support/callbacks.rb:136:in run_callbacks'
/Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/actionpack/lib/abstract_controller/callbacks.rb:41:in process_action' /Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/actionpack/lib/action_controller/metal/rescue.rb:22:in process_action'
/Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/actionpack/lib/action_controller/metal/instrumentation.rb:34:in block in process_action' /Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/activesupport/lib/active_support/notifications.rb:168:in block in instrument'
/Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/activesupport/lib/active_support/notifications/instrumenter.rb:23:in instrument' /Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/activesupport/lib/active_support/notifications.rb:168:in instrument'
/Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/actionpack/lib/action_controller/metal/instrumentation.rb:32:in process_action' /Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/actionpack/lib/action_controller/metal/params_wrapper.rb:248:in process_action'
/Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/activerecord/lib/active_record/railties/controller_runtime.rb:24:in process_action' /Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/actionpack/lib/abstract_controller/base.rb:134:in process'
/Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/actionview/lib/action_view/rendering.rb:32:in process' /Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/actionpack/lib/action_controller/metal.rb:191:in dispatch'
/Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/actionpack/lib/action_controller/metal.rb:254:in dispatch' /Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/actionpack/lib/action_dispatch/routing/route_set.rb:52:in dispatch'
/Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/actionpack/lib/action_dispatch/routing/route_set.rb:34:in serve' /Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/actionpack/lib/action_dispatch/journey/router.rb:52:in block in serve'
/Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/actionpack/lib/action_dispatch/journey/router.rb:35:in each' /Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/actionpack/lib/action_dispatch/journey/router.rb:35:in serve'
/Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/actionpack/lib/action_dispatch/routing/route_set.rb:830:in call' /Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/railties/lib/rails/engine.rb:524:in call'
/Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/railties/lib/rails/railtie.rb:190:in public_send' /Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/railties/lib/rails/railtie.rb:190:in method_missing'
/Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/actionpack/lib/action_dispatch/routing/mapper.rb:19:in block in <class:Constraints>' /Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/actionpack/lib/action_dispatch/routing/mapper.rb:48:in serve'
/Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/actionpack/lib/action_dispatch/journey/router.rb:52:in block in serve' /Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/actionpack/lib/action_dispatch/journey/router.rb:35:in each'
/Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/actionpack/lib/action_dispatch/journey/router.rb:35:in serve' /Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/actionpack/lib/action_dispatch/routing/route_set.rb:830:in call'
rack-attack (5.0.1) lib/rack/attack.rb:147:in call' rack-pjax (1.0.0) lib/rack/pjax.rb:12:in call'
rack-attack (5.0.1) lib/rack/attack.rb:147:in call' remotipart (1.3.1) lib/remotipart/middleware.rb:32:in call'
warden (1.2.7) lib/warden/manager.rb:36:in block in call' warden (1.2.7) lib/warden/manager.rb:35:in catch'
warden (1.2.7) lib/warden/manager.rb:35:in call' rack (2.0.3) lib/rack/etag.rb:25:in call'
rack (2.0.3) lib/rack/conditional_get.rb:25:in call' rack (2.0.3) lib/rack/head.rb:12:in call'
rack (2.0.3) lib/rack/session/abstract/id.rb:232:in context' rack (2.0.3) lib/rack/session/abstract/id.rb:226:in call'
/Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/actionpack/lib/action_dispatch/middleware/cookies.rb:674:in call' /Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/activerecord/lib/active_record/migration.rb:558:in call'
/Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/actionpack/lib/action_dispatch/middleware/callbacks.rb:28:in block in call' /Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/activesupport/lib/active_support/callbacks.rb:98:in run_callbacks'
/Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/actionpack/lib/action_dispatch/middleware/callbacks.rb:26:in call' /Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/actionpack/lib/action_dispatch/middleware/executor.rb:14:in call'
appsignal (2.3.3) lib/appsignal/rack/rails_instrumentation.rb:17:in call' appsignal (2.3.3) lib/appsignal/rack/js_exception_catcher.rb:32:in call'
/Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/actionpack/lib/action_dispatch/middleware/debug_exceptions.rb:61:in call' /Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/actionpack/lib/action_dispatch/middleware/show_exceptions.rb:33:in call'
/Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/railties/lib/rails/rack/logger.rb:38:in call_app' /Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/railties/lib/rails/rack/logger.rb:26:in block in call'
/Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/activesupport/lib/active_support/tagged_logging.rb:71:in block in tagged' /Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/activesupport/lib/active_support/tagged_logging.rb:28:in tagged'
/Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/activesupport/lib/active_support/tagged_logging.rb:71:in tagged' /Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/railties/lib/rails/rack/logger.rb:26:in call'
ahoy_matey (1.6.0) lib/ahoy/engine.rb:22:in call_with_quiet_ahoy' sprockets-rails (3.2.1) lib/sprockets/rails/quiet_assets.rb:13:in call'
/Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/actionpack/lib/action_dispatch/middleware/remote_ip.rb:81:in call' request_store (1.3.2) lib/request_store/middleware.rb:9:in call'
/Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/actionpack/lib/action_dispatch/middleware/request_id.rb:27:in call' rack (2.0.3) lib/rack/method_override.rb:22:in call'
rack (2.0.3) lib/rack/runtime.rb:22:in call' rack-rewrite (1.5.1) lib/rack/rewrite.rb:24:in call'
/Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/actionpack/lib/action_dispatch/middleware/executor.rb:14:in call' rack-livereload (0.3.16) lib/rack/livereload.rb:23:in _call'
rack-livereload (0.3.16) lib/rack/livereload.rb:14:in call' /Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/actionpack/lib/action_dispatch/middleware/static.rb:127:in call'
rack (2.0.3) lib/rack/sendfile.rb:111:in call' webpacker (3.0.1) lib/webpacker/dev_server_proxy.rb:17:in perform_request'
rack-proxy (0.6.2) lib/rack/proxy.rb:57:in call' /Users/richard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bundler/gems/rails-603475b76fe5/railties/lib/rails/engine.rb:524:in call'
/Users/richard/Library/Application Support/Pow/Versions/0.5.0/node_modules/nack/lib/nack/server.rb:155:in handle' /Users/richard/Library/Application Support/Pow/Versions/0.5.0/node_modules/nack/lib/nack/server.rb:109:in rescue in block (2 levels) in start'
/Users/richard/Library/Application Support/Pow/Versions/0.5.0/node_modules/nack/lib/nack/server.rb:106:in block (2 levels) in start' /Users/richard/Library/Application Support/Pow/Versions/0.5.0/node_modules/nack/lib/nack/server.rb:96:in each'
/Users/richard/Library/Application Support/Pow/Versions/0.5.0/node_modules/nack/lib/nack/server.rb:96:in block in start' /Users/richard/Library/Application Support/Pow/Versions/0.5.0/node_modules/nack/lib/nack/server.rb:76:in loop'
/Users/richard/Library/Application Support/Pow/Versions/0.5.0/node_modules/nack/lib/nack/server.rb:76:in start' /Users/richard/Library/Application Support/Pow/Versions/0.5.0/node_modules/nack/lib/nack/server.rb:12:in run'
/Users/richard/Library/Application Support/Pow/Versions/0.5.0/node_modules/nack/bin/nack_worker:4:in `

'


It appears the app crashes on lib/trestle/options.rb:12:in merge!'`. Apparently the Hash#deep_merge implementation has changed. I'm curious if this is an issue with Trestle or current Rails. Please feel free to close this if you think this is not a Trestle concern.

Adding custom view helpers

Are there any non-hacky ways to add custom helpers to the views?
Example:

# In my project using trestle
module ApplicationHelper
  def custom_method(name)
    ...
  end
end

Trestle.resource(:posts) do
  table do
    column :author, ->(post) { custom_method(post.author_name) }
  end
end

Maybe loading whatever's on app/helpers/trestle on the main app

Custom actions

I've almost ported over most of our rails_admin panels (which was very easy to do!) except for some custom actions. I would like to show a form section which can trigger a custom controller action other than updating the model instance.

Reading the source I couldn't find any methods to do this. Should I just link to a controller outside of Trestle, or is there a recommended approach to do this? E.g. we currently have an action like this:

<h4>Send update</h4>
<textarea name="body" rows="4" cols="40"></textarea><br>
<button name="commit" type="submit" value="update" class="btn btn-primary"><i class="icon-envelope icon-white"></i> Send update</button>
module RailsAdmin
  module Config
    module Actions
      class Updates < RailsAdmin::Config::Actions::Base

        ...

        register_instance_option :controller do
          proc do
            if params[:commit] == 'update'
              email = ::Emails::UpdatedEmail.new(@object)
              email.body = params[:body]
              email.send

              flash[:success] = 'Update successfully sent'
            end
          end
        end
      end
    end
  end
end

Creating has_many relations in multiple select field

Hi! I wanted to know if it's posible to add, to the edit form, a multiple select field for a has_many relationship. I tried with collection_check_boxes and it shows all the checkboxes, but it won't save. Also tried with collection_select and services, but it's not a multiple select and i won't save either.

Love the admin! I hope this is possible

Thanks!

Dependency on sass-rails

I wonder if you can remove the sass-rails dependency and expose a precompiled CSS, leaving the possibility to use the .scss files opt-in instead:

  • no dependency beats anything else anytime
  • sass compilation in userland is hazardous at best since you can't be sure your variables won't collide with the user's someday. It is a big source of problematic issues
  • not sure you can maintain a public API from a stylesheet and not break Semver
  • sass-rails compilation will slow down dev Trestle first page load and global deployments for all your users

My 2 cents.

I18N support

Do you have a plan to support i18n or module for it?

Any plans for batch editing?

Apologies if this is the wrong place, but we've actually been looking to either change off our backend framework or create our own. One of the key features we need is the ability to mass-select and edit all items to set multiple many-to-many associations.

Would this feature be something planned or that would fit in this framework?

Rails dependency

You should depend on railties rather than rails, so you won't force extra frameworks onto people who've skipped them. That does then imply you should also depend on any additional frameworks you do actually require.. but at a brief glance, there may not be any?

(Note rails itself is completely empty: it is nothing but a list of default dependencies. The interesting bits are all in railties, so you're not missing out on anything by doing this.)

Custom actions

Good job! This is great!

How to disable ability to delete a resource?

Trestle in Gemfile causes ExecJS error

This is a bit of a strange one: I'd assumed that I'd used some ES6 somewhere by mistake but it seems that if Trestle is included in my Gemfile then rake assets:precompile RAILS_ENV=production fails with:

yarn install v0.27.5
warning package.json: No license field
warning No license field
[1/4] Resolving packages...
success Already up-to-date.
Done in 2.43s.
rake aborted!
ExecJS::RuntimeError: SyntaxError: Unexpected token: punc ())
JS_Parse_Error.Object.defineProperty.get ((execjs):3538:621)
(execjs):4060:47
(execjs):1:102
Object.<anonymous> ((execjs):1:120)
Module._compile (module.js:556:32)
Object.Module._extensions..js (module.js:565:10)
Module.load (module.js:473:32)
tryModuleLoad (module.js:432:12)
Function.Module._load (module.js:424:3)
Module.runMain (module.js:590:10)
/Users/joe/.rbenv/versions/2.4.0/bin/bundle:22:in `load'
/Users/joe/.rbenv/versions/2.4.0/bin/bundle:22:in `<main>'
Tasks: TOP => assets:precompile
(See full trace by running task with --trace)

Running the command without RAILS_ENV=production works fine, as does removing the entry from the Gemfile, deleting the initializer and re-running rake assets:precompile RAILS_ENV=production.

I'm using Rails 5.1, Yarn and Webpack (eeeugh!)

Rendering autoformatted value for table column cell in case of block

if i use

# products_admin.rb

table do
    column :category
end

it autoformats category cell value with belongs_to :category into a link to category instance

but if i use

column do |instance|
      instance.category #it is not making much sense in exact this case but lets assume i need exact this syntax (i have more difficult situation, but do not want to mess with it here)
end

it shows unpleasant instance.inspect output #<Category:0x007fd2eeb1ed60>. is it wrong behavior or do i have to do something more inside a block?

all i digged for now is

column do |instance|
   self.display(instance.category)
end

but it gives only a name of category without admin_link_to

How do you customize the title of admin pages?

I have a model called Activity. How do I get the title to display Editing #{instance.name} instead of the generic "Editing Activity" without writing my own `resource/show.html.erb?

I looked for a hook for this and didn't see if this was possible.

Generic html (erb partial) page

It would be nice to include into admin structure other than table pages with any custom html i want to insert. Like "Wiki" or "FAQ" or iframes with some analytics/graphs or ... . Are there any plans for this?

Trestle.resource(:faq) do
  menu do
    group :info do
      item :faq, icon: "fa fa-question"
    end
  end

  page do
    render 'faq'# leading to _faq.html.erb partial
  end
end

or, maybe, even simpler within any other resource's menu do;end block

Trestle.resource(:administrators, model: Trestle.config.auth.user_class, scope: Auth) do
  menu do
    group :configuration, priority: :last do
      item :administrators, icon: "fa fa-users"
    end
    group :info do
      page :faq, partial: 'faq'
      page :shmaq, partial: 'shmaq'
    end
  end
#...
end

Thanks

Custom field example

Apologies - this isn't really an issue but I wasn't sure where else to ask.

I see that, in the Trestle config, you can define custom field types. However, I'm not really sure how this works.

class CustomFormField
  def initialize(builder, template, name, options={}, &block)
    
  end
  def render

  end
end

Would it be possible to provide a simple example (say, if I wanted to override the email_field to include an email icon, similar to the datetime_field)

Thanks :)

navigation usability problem

I have a lot of ul-li groups of menu items at left nav bar (long scrollable div)

If i click on something from the bottom of the list, i lost focus where i am in menu. so... i wrote for now quick solutions for two cases:

1 pre-scroll to current menu item
2 ability to toggle groups and save their states

toggleSiblings = (e) ->
  e.siblings().toggle()
  e.find('i').toggleClass('fa-chevron-right fa-chevron-down')

saveToggleState = (v) ->
  c = JSON.parse(localStorage.getItem('clicked-nav-headers'))
  a = if $.isArray(c) then c else []
  i = a.indexOf(v)
  if i == -1 then a.push v else a.splice i, 1
  localStorage.setItem('clicked-nav-headers', JSON.stringify(a))

$(document).ready ->
  # clickable nav headers with saving it's states
  $('.nav-header').css('cursor','pointer').prepend('<i class="fa fa-chevron-down" style="color: grey"></i> ').on 'click', (e) ->
    toggleSiblings($(this))
    saveToggleState($(this).parent().index())
  if localStorage.getItem('clicked-nav-headers')!=undefined
    cnh = JSON.parse(localStorage.getItem('clicked-nav-headers'))
    if $.isArray(cnh)
      cnh.forEach (e) ->
        toggleSiblings($($('.nav-header')[e]))
  # prescroll
  $('.app-sidebar-inner').animate { scrollTop: $('.app-nav .active').offset().top-100 }, 100

hope something similar will be included in next releases

i know, it has a clearness problem for collapsed nav bar (just because groups are represented only by dashes, i would leave a first letter of group name, for example) but it is not vital for me for now

Basic Auth

Are there any plans to add a basic auth authentication method?

I don't need actual users for my use case.

actions column enhancements

I tried to do something like this

table do
  #...
  actions header: 'Act', data: {info: 'some info'}
end

but received wrong number of arguments (given 1, expected 0)

if i look to the code

def actions(&block)
  table.columns << ActionsColumn.new(table, &block)
end

this is expected but i think it would be useful to have exact same options as for any other table's column

And another request:

for now, as i can see, there is only one action: delete (but method name is plural - actions), so it is not makes much sense to use a block construction unless - see my code comments above

actions do |a|
  a.delete
  a.show # or a.edit would be useful too, in case user want to disable default full-row "clickability" with admin: false option (as i digged somehow - maybe it is wrong)
  a.any_other_custom_action #defined in controller do end block
end

and so, if actions will become really plural (multiple), they possibly need a btn-group bootstrap container

Enum support

First of all thanks for this great library. Fantastic onboarding experience!

Is there any recommended approach for ActiveRecord enums in forms? Ideally I'd like to have a select box with the possible values and the selected value pre-selected. I tried the select helper as well as collection_radio_buttons but couldn't get the actual value to pre-select.

# app/models/booking.rb
class Booking < ApplicationRecord
  enum status: {
    initiated: 0,
    requested: 1,
    accepted: 2,
    rejected: 3,
    cancelled: 4
  }
end

# app/admin/bookings_admin.rb
...

form do |booking|
  select :status, choices: Booking.statuses.to_a, selected: booking.status
end

While the form component code looks really clear I couldn't figure out how to create a custom type, otherwise I would have issued a PR directly!

Pre-fill form inputs according to url params

Let it be two entities: Product and Category

On Category index page i have a column with a button:

    <a href="/admin/products/new?category_id=666">Add product</a>

If i click it i expect that a category dropdown list be pre-selected with corresponding option...

i can imagine two ways to get universal solution for any default form:

1 javascript
2 modify trestle's form builder

and the first one seems more reasonable for me for now if ...?

controller's respond_to.js is not consistent

Here

(same for update and destroy actions)

we can see format.js block in case of successful action. but it is absent in case of error here

Of course, I don't know why you add format.js, but all i can imagine - is to support an "in-place" resource editing..

If so, i would suggest to add those, as far as make @instance = instance to minimally serve js formatted requests out of the box with /views/admin/{resource_name}/{show|create|update|destroy}.js.erb views

Because now my way to get bootstrap modal with in-place resource's show page instead of redirect (it's hacky, i know, sorry for that) is to override redirect_to and define_layout with this

<a href='#{admin_url_for instance}' data-toggle='modal' data-target='#modal'>edit</a>"
    layout :define_layout

      def redirect_to *args
        if request.xhr?
          render 'admin/refresh.js.erb', instance: instance
        else
          super *args
        end
      end

      private

      def define_layout
        if request.xhr?
          false
        else
          'trestle/admin'
        end
      end

but even this (what am i expecting else with my code smell like this? =)) became broken since the update from 0.8.2 to 0.8.5 because now your controller serve js request by itself but with an empty block

so, hope you are preparing trestle for modal-bootstrapped in-place editing or, please, shade some light what is the reason of format.js blocks

Postgres Array serialises with extra null value

I was excited to see here that Postgres array support has landed. So I updated the ref in my Gemfile to 2f202a5.

I have a model with an array column like:

t.integer "payment_methods", default: [0], array: true

Before save, the column value is:

model.payment_methods.inspect
=> "[0]"

When I save the value becomes:

model.payment_methods.inspect
=> "[nil, 0]"

screen shot 2017-08-20 at 14 38 52

This is my admin config:

select :payment_methods, nil, {}, { multiple: true, data: { tags: true, select_on_close: true }}

JSON(B) serialisation issue

When I save an instance with a JSONB field, the field value gets converted to a string.

create_table "bookings", id: :serial, force: :cascade do |t|
    ...
    t.jsonb "client_params"
end

Configured with text_area (but this also occurs with auto configuration)

form do |booking|
  text_area :client_params
end

Value before save:

puts instance.client_params
=> {"language"=>"en", "inbound_date"=>"2017-08-10"}

Value after save:

puts instance.client_params
=> "{\"language\"=>\"en\", \"inbound_date\"=>\"2017-08-10\"}"

I'm guessing we might need to do some parsing (RailsAdmin JSON field ref) but couldn't figure this out unfortunately.

Dependent fields / custom JS

I know documentation is still coming, so I've been getting up to speed by reading the code and looking at the examples.

For field dependencies where you have some dynamic control over what is required / displayed if a user selects a certain choice, how do you handle this?

For instance, if the user checks a box, I need to display another field for them to fill out. How do you handle these cases?

Thanks!

Generator creates CoffeeScript file even if not using it

Steps to reproduce:

rails new testproject --webpack --skip-turbolinks --skip-test --skip-action-cable && cd testproject

Remove gem 'coffee-rails', '~> 4.2' from Gemfile and, if applicable, any references from /app/assets/javascript/application.js

Add gem 'trestle' to Gemfile and run bundle install

Run rails generate trestle:install

Running via Spring preloader in process 80339
      create  config/initializers/trestle.rb
      create  app/assets/stylesheets/trestle/_variables.scss
      create  app/assets/stylesheets/trestle/_custom.scss
      create  app/assets/javascripts/trestle/custom.js.coffee
      create  app/admin

Thanks for your work on the project.

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.