Coder Social home page Coder Social logo

hobo / hobo Goto Github PK

View Code? Open in Web Editor NEW

This project forked from tslocke/hobo

102.0 23.0 39.0 11.94 MB

The web app builder for Rails (moved from tablatom/hobo)

Home Page: http://hobocentral.net

Ruby 75.50% Gherkin 7.57% HTML 4.33% JavaScript 10.97% CSS 1.37% Shell 0.27%

hobo's Introduction

Codeship Status for Hobo/hobo

Welcome to Hobo

Hobo is an Open Source extension to Ruby on Rails which helps you build full blown web applications incredibly quickly and easily. Available as a Gem or Rails plugin, Hobo provides a simple, clean and elegant development framework which allows for rapid prototyping or production of the most sophisticated web applications.

Main Features

  • Rapid implementation of dynamic Ajax interfaces in your application with no extra programming.
  • Switchable themes. Customise and tweak your application structure and layout to meet any design goals.
  • Powerful mark-up language, DRYML, combines rapid development with ultimate design flexibility. The end of the cookie cutter blues!

RDOC Note

This is also the front page to the Hobo RDOC. RDOC is not the main documentation method for Hobo. See hobocentral for the Hobo documentation.

hobo's People

Contributors

adoyen avatar al2o3cr avatar aughr avatar bernardo avatar betelgeuse avatar blizz avatar bronson avatar bryanlarsen avatar careljonkhout avatar davelnewton avatar ddnexus avatar devcurmudgeon avatar drnic avatar egomolka avatar enwood avatar gamafranco avatar harvj avatar iox avatar jezc avatar jorahood avatar kredmer avatar mgiorgi avatar minktom avatar proton avatar silvrbak avatar spiralis avatar stevemadere avatar tacid avatar tjhayasaka avatar tslocke 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  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

hobo's Issues

Can't specify multiple subsites on a lifecycle transition

I have an application where the same transitions are to be enabled on multiple subsites. Rather than duplicating the transition code, it would be better to pass multiple subsites to the :subsite directive.

Existing code in hobo/model/lifecycles/actions.rb

def routable_for?(subsite)
  publishable? && options[:subsite] == subsite
end

Suggested (untested) improvement:

def routable_for?(subsite)
  subsites = options[:subsite]
  subsites = [subsites] unless subsites.respond_to? :member?
  publishable? && subsites.member? subsite
end

hobo migration generates drop indexes in the wrong place in the migration

When hobo migration generates a migration where an indexed column has been dropped, it adds a "remove_index" directive after the "remove_column" directive, which causes the migration to fail when using mysql (it sees to work when using sqlite).

Here is an example migration that was generated by hobo:

class HoboMigration3 < ActiveRecord::Migration
  def self.up
    remove_column :accounts, :user_id

    remove_index :accounts, :name => :index_accounts_on_user_id rescue ActiveRecord::StatementInvalid
  end

  def self.down
    add_column :accounts, :user_id, :integer

    add_index :accounts, [:user_id]
  end
end

To prevent rake db:migrate problems, I manually move the "remove_index" directives to before the "remove_column" index.

Confirm Delete Dialog record indiation

The javascript dialog box that open when deleting a record should include some indication of which record is being deleted. IE include the in the message box. This is more important on the action buttons in tables where the user could click on the wrong row by mistake and the dialog box gives them no indication on which record they are about to delete.

This would need to flow down to hobo_bootstrap once in hobo main

Bob

inlined new-form error if object is invalid

Hi have a hobo-model "Provider" with following fields:

fields do
name :string, :required
timestamps
end

the controler inlines the new-form:

auto_actions :all, :except => :new

Works fine:
submitting a valid "name"

Throws error:
submitting the new-form with an empty "name"


Trace:

NoMethodError in Providers#index

Showing controller: providers; dryml-tag: index-page where line #1 raised:

undefined method `member_class' for #<Provider id: nil, name: "", created_at: nil, updated_at: nil>
Extracted source (around line #1):

0

Application Trace | Framework Trace | Full Trace
app/views/taglibs/auto/rapid/pages.dryml:371:in block (8 levels) in index_page__for_provider' app/views/taglibs/auto/rapid/pages.dryml:370:inblock (7 levels) in index_page__for_provider'
app/views/taglibs/auto/rapid/pages.dryml:370:in block (6 levels) in index_page__for_provider' app/views/taglibs/auto/rapid/pages.dryml:369:inblock (5 levels) in index_page__for_provider'
app/views/taglibs/auto/rapid/pages.dryml:369:in block (4 levels) in index_page__for_provider' app/views/taglibs/auto/rapid/pages.dryml:362:inblock (3 levels) in index_page__for_provider'
app/views/taglibs/auto/rapid/pages.dryml:359:in block in index_page__for_provider' app/views/taglibs/auto/rapid/pages.dryml:358:inindex_page__for_provider'
Request

Parameters:

{"page_path"=>"/providers",
"authenticity_token"=>"x97q087vrCEBvuJnc4tCEIbYzMMuoa/kRviRAijsDIA=",
"provider"=>{"name"=>""}}
Show session dump

Show env dump

Response

Headers:

None

dryml partial crashes app the second and later times it is rendered

I have had major dryml problems when trying to use partials written in dryml. Partials with the same functionality written in html work fine.

Refreshing the offending page from the sample app generates:

undefined method `appviews_front__f_dryml__907223664903458373_69925963162780' for #<#Class:0x00000003807138:0x0000000383b028>

The sample app renders a dryml partial from the front page which demonstrates the problem. It also renders a html partial from the hfront page; this does NOT crash.

The sample app is located at [email protected]:dziesig/dryml-partial-bug.git

Incompatibility with facets gem

Gemfile:

gem "hobo", "= 1.3.2"
gem "facets"

bundle update
rails c

/Users/meesern/.rvm/gems/ruby-1.9.3-p194/gems/dryml-1.3.2/lib/dryml/railtie.rb:21:in block (2 levels) in <class:Railtie>': uninitialized constant Dryml::Taglib (NameError) from /Users/meesern/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.0.17/lib/active_support/callbacks.rb:420:in_run_prepare_callbacks'
from /Users/meesern/.rvm/gems/ruby-1.9.3-p194/gems/actionpack-3.0.17/lib/action_dispatch/middleware/callbacks.rb:40:in `initialize'
etc..

Gemfile:
gem "hobo","= 1.3.2"

gem "facets"

bundle update
rails c
Loading development environment (Rails 3.0.17)
1.9.3p194 :001 >

Password fields not showing for Administrator in a invitation only web site

Generate a new hobo application using the following answers:

  • Do you want to start the Setup Wizard now? y
  • Choose a name for the user resource:
  • Do you want to send an activation email to activate the user? y
  • Do you want to add the features for an invite only website? y
  • Do you want to prevent all access to the site to non-members? y
  • Will your application use only hobo/dryml web page templates? y
  • Do you want to customize the test_framework? n
  • Choose a name for the front controller:
  • Choose a theme for the front site:
  • Choose a jQuery-UI theme for the front site:
  • Choose a name for the admin subsite:
  • Choose a theme for the admin site:
  • Choose a jQuery-UI theme for the admin site:
  • Initial Migration: m
  • Type the locales (space separated) you want to add to your application:
  • Do you want to initialize a git repository now? y
  • Do you want git to ignore the auto-generated files? y

Then run "rails s", which results in only two fields being shown: "Name" and "Email address". The "Password" and "Password confirmation" fields are missing, preventing the creation of an administrator user.

Need to restore support for passing additional form parameters as attribute to <form>

Up to Hobo 1.3, we used to be able to pass additional form parameters as an attribute to the <form> tag, as follows:

<form web-method="addparcel" method="POST" params="&{'document_id' => this.id}" update="parcels-div" message="Searching..." refocus-form>

Bryan, you mentioned that this requires javascript support but wasn't something ported from prototype.js to jquery.

Add debugging instructions

Currently fixing a bug in Hobo can only be done by very few "initiated" people, leaving a lot of motivated developers unsatisfied. We should make this process super easy, creating a small tutorial about fixing a bug like #54 in a fun and interesting way:

  • Using better errors
  • Navigating through the Hobo source
  • Playing around in the Hobo source
  • "Connecting" the Hobo source to our application (using ":path" in Gemfile)
  • Fixing the bug
  • Running the integration tests
  • Sharing the solution

Bundler error while creating a new application

It looks like the release of jquery-rails 3.0 has broken the Hobo wizard:

Bundler could not find compatible versions for gem "jquery-rails":
  In Gemfile:
    hobo_bootstrap_ui (= 2.0.0) ruby depends on
      jquery-rails (~> 2.0) ruby

    jquery-rails (3.0.1)

Bundler could not find compatible versions for gem "hobo_bootstrap":
  In Gemfile:
    hobo_bootstrap (= 2.0.0) ruby

    hobo_bootstrap_ui (= 2.0.0) ruby depends on
      hobo_bootstrap (2.0.0.pre1)

Bundler could not find compatible versions for gem "hobo_jquery_ui":
  In Gemfile:
    hobo_bootstrap_ui (= 2.0.0) ruby depends on
      hobo_jquery_ui (= 2.0.0.pre3) ruby

    hobo_jquery_ui (2.0.0)

Confusing warning in wizard about will_paginate

I just created a new app with Hobo 2.0.0.pre4 and I saw this warning:

WARNING: unable to activate will_paginate 3.0.4.hobo. Please add gem "will_paginate", :git => "git://github.com/Hobo/will_paginate.git" to your Gemfile.

It turns out that later on the wizard adds the will_paginate git repository to the Gemfile, so this warning is not necessary. It would be nice to remove it.

Couple of minor issues in Hobo 2.0.0.pre4 with bootstrap theme

I created a new vanilla Hobo app, with bootstrap, redmond.

Issue 1: ActionController::RoutingError (No route matches [GET] "/assets/hobo_bootstrap/ajax-loader.gif"):

Issue 2: the search box on an empty app is aligned to the top of the screen (in part because it's within a form-horizontal class, so it gets margin-top: -5px; ) so it looks messy vs the other onscreen elements

auto_actions :except does not work with Admin::AdminSiteController

auto_actions :except => :new
works fine for Controllers which reside in the controllers/ folder and inherit from ApplicationController,
but the :except is ignored if I use the admin subsite and the controllers in the admin/ folder inherit from the Admin::AdminSiteController

I use 2.0.0.pre8 from git

a small update:
the behaviour is also correct if the controller inherits Admin::AdminSiteController and it is in the controllers/ folder (and not in admin/)

Hobo 2.0.0: <live-editor> should be able to update more than one part

Was expecting this to update both parts:

<field-list fields="my_text">  
  <my-text-view:>
    <div part="div-my-text">
      <live-editor-innards updates="div-my-text,div-history"/>
    </div>
  </my-text-view:>
</field-list>
<div part="div-history">
  <field-list fields="created_at, updated_at"/> 
</div>

but it does not.

Bryan suggested

<live-editor-innards updates="div-wholly-cancelled,div-history" ajax="&false"/>

but to no effect.

Hobo bootstrap dependency problem

hobo bootstrap depends on jquery rails. With the latest jquery rails gem (3.x) it's failing. We need to change the gem dependencies to fix this ASAP.

Reported by Tim Griffin.

Hob routing error -- can't find reverse association

I believe that this error gets raised when creating owner actions for a model that that uses a :foreign_key option in the has_many directive.

The problem is the :foreign key directive passes the key into the reflection as a symbol, rather that as a string which is what it be otherwise, causing the failure of a comparison that is expected to be true.

hobo:migration won't stop trying to create a join table

Hobo fields migration is trying to create a join table over and over again (i.e. you run hobo:migration the first time, it creates the table, and then tries to create it again on next run). Anyone else experiencing this?

Alert the user when using possibly conflicting words as model names

Some common errors come from naming models with words that later create conflicts. It would be nice if we introduced some checks in the generators to help users.

Examples:

hobo generator cannot adjust rails version

The hobo generator command has this form:

hobo new name [hobo_opt] [rails_opt]

but to specify the rails version, rails takes this form:

rails _*version*_ new name

Fixing this shouldn't be difficult, but I'm not exactly sure what form it should take ATM. Thoughts?

An "invited" user cannot reset his/her password

The only way to recover from a lost invitation is to delete and recreate the user (which is not desirable in my case) because there is no way for the administrator to resend the invitation and the reset password button generates a "No transition request_password_reset available".

The following transition is missing from the User lifecyle:

    transition :request_password_reset, { :invited => :invited }, :new_key => true do
      UserMailer.invite(self, lifecycle.key).deliver
    end

Hobo generates invalid HTML

I generated a new application (with admin subsite), started the server and validated the home page using the www3 validator (through Opera) and got the following results:

Validation Output: 5 Errors
Line 132, Column 446: Attribute remove-class not allowed on element form at this point.
…="post" remove-class="form-horizontal">

<input id="p…
Attributes for element form:
Global attributes
accept-charset
action
autocomplete
enctype
method
name
novalidate
target
Line 150, Column 163: Duplicate ID page_path.
…me="page_path" type="hidden" value="/"><input name="authenticity_token" type="…


Line 132, Column 536: The first occurrence of ID page_path was here.
…me="page_path" type="hidden" value="/"><input name="authenticity_token" type="…


Line 150, Column 353: Attribute fields not allowed on element div at this point.
…="name, email_address, password, password_confirmation">


Attributes for element div:
Global attributes
Line 194, Column 7: End tag for body seen, but there were unclosed elements.


Line 193, Column 363: Unclosed element span.
…AA==--6c06d93d75f861cfc99ebf57331669fc5aed95dc"}}" style="display: none;">

admin controllers should inherit from Admin::AdminSiteController

when I let hobo generate the admin subsite (model name "Login" instead of default "User"),
then the admin/logins_controller.rb extends the normal ApplicationController instead of Admin::AdminSiteController.

generated:
class Admin::LoginsController < ApplicationController

should be:
class Admin::LoginsController < Admin::AdminSiteController

I use 2.0.0.pre7

HTTPS Termination causing rapid reorder URL to be incorrect

Hey

Encountering an issue on one of our Hobo systems being caused by a little issue with the URL being outputted.

We terminate SSL at an NginX instance before the request reaches the rails server running the Hobo application.

The URL being outputted in the "data-rapid" attribute is an HTTP URL meaning that jQuery decides the request is crossdomain and makes the request as a GET instead of a POST (due to including it as a script rather than actually using AJAX).

data-rapid attribute

jQuery request attempt

I believe the code causing this issue is in the following file:

https://github.com/Hobo/hobo/blob/master/hobo_jquery_ui/taglibs/sortable_collection.dryml

I think this would probably be fixed by removing the domain part altogether and making the URL relative to the root of the domain. As far as I can think, there is no case in which it would work otherwise anyway.

Does what I've said seem to be correct? If so, I'm happy to have a go at fixing the issue, but if not, could you point me in the right direction? Thanks.

Thanks
James

2.0.0.pre7 hobo_login - block returning false allows login on second attempt

(Ticket 1025 from Lighthouse)

According to notes CHANGES-1.1.txt, returning false from a block passed to hobo_login will prevent the user from logging in.

In a new test 2.0.0.pre7 application, Hobo is allowing a login on a second attempt even if hobo_login block returns false.

Simple test:

def login hobo_login do flash[:error] = "This is just a test." return false end end
On first login, you will be rejected and the flash[:error] message will be shown. If you then try again, you will be granted access.

Even adding
current_user.forget_me
before returning false doesn't make a difference.

Array.rb missing

Hello,

File lib\hobo\extensions\array.rb is missing in 2.0.0.pre2 and 2.0.0.pre3.
As a results I have following error message:

undefined local variable or method `origin' for #<Array:0x5b6c968>

Could you please remediate or advice how to overcome that problem.

Thank you in advance,
Denis.

Using 'home_page' instead of 'root_url' causes mismatches on MiniTest assert_redirected_to

Hi all;

Should Hobo's home_page method be returning a trailing "/" as well to be consistent with route helpers (i.e. "http://test.host/")

Here's why I'm asking: Something simple tripped me up for a while with a Controller test.

My test:

describe TitlesController do 
  it "Regular user should not be able to see Titles index" do
    controller_test_signin @user  #Defined in test_helper.rb
    get :index
    assert_redirected_to( root_url )
  end

In my environment/test.rb file, I have

  Rails.application.routes.default_url_options[:host] = 'test.host'

to satisfy url_for's demand for a 'host to link' to

(ArgumentError: Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true)

However, running this controller test using was giving me:

Expected response to be a redirect to <http://test.host/> but was a redirect to <http://test.host>

(Notice the absence of the "/" at the end of the actual redirect url?)

I tracked it down to my use of Hobo's home_page method in a before_filter I had in my ApplicationController:

  def lto_only  
    if !current_user.administrator? && !current_user.officer?
      redirect_to home_page 
      return
    end

It turns out that to get my assert_redirected_to test to pass, this needed to be:

  def lto_only  
    if !current_user.administrator? && !current_user.officer?
      redirect_to root_url 
      return
    end

Of course, my use of root_url requires me to have 'root' defined in my routes.rb file.

  root :to => 'front#index'

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.