kurenn / sabisu-rails

Simple and powerful engine for exploring your Rails api application
MIT License
127 stars 29 forks source link

No input found for inet #20

Closed jakehockey10 closed 9 years ago

jakehockey10 commented 9 years ago

Hello,

When I go to the url http://localhost:3000/sabisu_rails/explorer, I get an error that reads 'No input found for inet'.

no_input_found_for_inet

I have a feeling that my gem versions are slightly different and are the cause to this problem, so here is my Gemfile.lock:

GIT
  remote: git://github.com/IcaliaLabs/sabisu-rails.git
  revision: de6340971e70589de2ae2cb0d8170a9a9df84103
  specs:
    sabisu_rails (0.0.2.beta)
      actionpack (~> 4.0)
      activemodel (~> 4.0)
      httparty (~> 0.13)

GEM
  remote: https://rubygems.org/
  specs:
    actionmailer (4.1.8)
      actionpack (= 4.1.8)
      actionview (= 4.1.8)
      mail (~> 2.5, >= 2.5.4)
    actionpack (4.1.8)
      actionview (= 4.1.8)
      activesupport (= 4.1.8)
      rack (~> 1.5.2)
      rack-test (~> 0.6.2)
    actionview (4.1.8)
      activesupport (= 4.1.8)
      builder (~> 3.1)
      erubis (~> 2.7.0)
    active_model_serializers (0.9.2)
      activemodel (>= 3.2)
    activemodel (4.1.8)
      activesupport (= 4.1.8)
      builder (~> 3.1)
    activerecord (4.1.8)
      activemodel (= 4.1.8)
      activesupport (= 4.1.8)
      arel (~> 5.0.0)
    activesupport (4.1.8)
      i18n (~> 0.6, >= 0.6.9)
      json (~> 1.7, >= 1.7.7)
      minitest (~> 5.1)
      thread_safe (~> 0.1)
      tzinfo (~> 1.1)
    arel (5.0.1.20140414130214)
    bcrypt (3.1.9)
    better_errors (2.0.0)
      coderay (>= 1.0.0)
      erubis (>= 2.6.6)
      rack (>= 0.9.0)
    binding_of_caller (0.7.2)
      debug_inspector (>= 0.0.1)
    builder (3.2.2)
    chunky_png (1.3.3)
    coderay (1.1.0)
    coffee-rails (4.0.1)
      coffee-script (>= 2.2.0)
      railties (>= 4.0.0, < 5.0)
    coffee-script (2.3.0)
      coffee-script-source
      execjs
    coffee-script-source (1.8.0)
    compass (0.12.2)
      chunky_png (~> 1.2)
      fssm (>= 0.2.7)
      sass (~> 3.1)
    compass-rails (2.0.0)
      compass (>= 0.12.2)
    debug_inspector (0.0.2)
    devise (3.4.1)
      bcrypt (~> 3.0)
      orm_adapter (~> 0.1)
      railties (>= 3.2.6, < 5)
      responders
      thread_safe (~> 0.1)
      warden (~> 1.2.3)
    diff-lcs (1.2.5)
    erubis (2.7.0)
    execjs (2.2.2)
    factory_girl (4.5.0)
      activesupport (>= 3.0.0)
    factory_girl_rails (4.5.0)
      factory_girl (~> 4.5.0)
      railties (>= 3.0.0)
    ffaker (1.25.0)
    font-awesome-rails (4.2.0.0)
      railties (>= 3.2, < 5.0)
    fssm (0.2.10)
    furatto (1.3.7)
      actionpack (>= 3.0)
      activemodel (>= 3.0)
      railties (>= 3.0)
    hike (1.2.3)
    httparty (0.13.3)
      json (~> 1.8)
      multi_xml (>= 0.5.2)
    i18n (0.7.0)
    jquery-rails (3.1.2)
      railties (>= 3.0, < 5.0)
      thor (>= 0.14, < 2.0)
    json (1.8.1)
    mail (2.6.3)
      mime-types (>= 1.16, < 3)
    mime-types (2.4.3)
    minitest (5.5.0)
    multi_json (1.10.1)
    multi_xml (0.5.5)
    orm_adapter (0.5.0)
    pg (0.17.1)
    rack (1.5.2)
    rack-test (0.6.2)
      rack (>= 1.0)
    rails (4.1.8)
      actionmailer (= 4.1.8)
      actionpack (= 4.1.8)
      actionview (= 4.1.8)
      activemodel (= 4.1.8)
      activerecord (= 4.1.8)
      activesupport (= 4.1.8)
      bundler (>= 1.3.0, < 2.0)
      railties (= 4.1.8)
      sprockets-rails (~> 2.0)
    railties (4.1.8)
      actionpack (= 4.1.8)
      activesupport (= 4.1.8)
      rake (>= 0.8.7)
      thor (>= 0.18.1, < 2.0)
    rake (10.4.2)
    rdoc (4.2.0)
      json (~> 1.4)
    responders (1.1.2)
      railties (>= 3.2, < 4.2)
    rspec-core (3.1.7)
      rspec-support (~> 3.1.0)
    rspec-expectations (3.1.2)
      diff-lcs (>= 1.2.0, < 2.0)
      rspec-support (~> 3.1.0)
    rspec-mocks (3.1.3)
      rspec-support (~> 3.1.0)
    rspec-rails (3.1.0)
      actionpack (>= 3.0)
      activesupport (>= 3.0)
      railties (>= 3.0)
      rspec-core (~> 3.1.0)
      rspec-expectations (~> 3.1.0)
      rspec-mocks (~> 3.1.0)
      rspec-support (~> 3.1.0)
    rspec-support (3.1.2)
    sass (3.2.0)
    sass-rails (4.0.3)
      railties (>= 4.0.0, < 5.0)
      sass (~> 3.2.0)
      sprockets (~> 2.8, <= 2.11.0)
      sprockets-rails (~> 2.0)
    sdoc (0.4.1)
      json (~> 1.7, >= 1.7.7)
      rdoc (~> 4.0)
    shoulda-matchers (2.7.0)
      activesupport (>= 3.0.0)
    simple_form (3.1.0)
      actionpack (~> 4.0)
      activemodel (~> 4.0)
    sprockets (2.11.0)
      hike (~> 1.2)
      multi_json (~> 1.0)
      rack (~> 1.0)
      tilt (~> 1.1, != 1.3.0)
    sprockets-rails (2.2.2)
      actionpack (>= 3.0)
      activesupport (>= 3.0)
      sprockets (>= 2.8, < 4.0)
    thor (0.19.1)
    thread_safe (0.3.4)
    tilt (1.4.1)
    tzinfo (1.2.2)
      thread_safe (~> 0.1)
    uglifier (2.6.0)
      execjs (>= 0.3.0)
      json (>= 1.8.0)
    warden (1.2.3)
      rack (>= 1.0)

PLATFORMS
  ruby

DEPENDENCIES
  active_model_serializers
  better_errors
  binding_of_caller
  coffee-rails (~> 4.0.0)
  compass-rails
  devise
  factory_girl_rails
  ffaker
  font-awesome-rails
  furatto
  jquery-rails
  pg
  rails (= 4.1.8)
  rspec-rails
  sabisu_rails!
  sass-rails (~> 4.0.3)
  sdoc
  shoulda-matchers
  simple_form
  uglifier (>= 1.3.0)

I'm fairly used to 4.1.8 and have been playing with 4.2.0.beta#, so I don't necessarily want to downgrade to 4.0 like in the tutorial I'm following here: http://apionrails.icalialabs.com/book. Does anyone know what I can do to use the sabisu rails api explorer without having to downgrade anything? Or is that my only option? If so, what do I need to downgrade, exactly? Thanks!

albertpak commented 9 years ago

I've ran into same issue...any updates on this issue?

kurenn commented 9 years ago

It seems like it is a problem with simple form, have you tried updating it?

$ bundle update simple_form
albertpak commented 9 years ago

Yes, and i have: Ruby 2.1.3, Rails 4.1.7, Simple Form 3.1.0

Showing /.rvm/gems/ruby-2.1.3@appapi/bundler/gems/sabisu-rails-de6340971e70/app/views/sabisu_rails/explorer/index.html.erb where line #36 raised:

<div class="appeareable">
  <% @explorer.resource_columns.each do |column| %>
   <%= f.input column, input_html: {name: "#{@explorer.resource_name}[#{column}]" }, as: @explorer.column_type(column), required: @explorer.required_attribute?(column) %>
  <% end %>
</div>

Request

Parameters:

{"explorer"=>{"resource"=>"users"}}
Niteshvgupta commented 9 years ago

same issue, tried updating simple_form, no results. @albertpak did you ever find a solution?

kurenn commented 9 years ago

Everything looks fine, I cannot reproduce the error, the only thing different is the rails version, have you tried to use 4.0 instead of 4.1?

Niteshvgupta commented 9 years ago

Ah, that might be it. I'm currently using Rails 4.2. Will try 4.0 and get back to you. Thank you for looking into it.

samuelralak commented 9 years ago

I am facing the same issue. I have event tried downgrading to Rails 4.0 (major inconvenience) but this issue still persists. any leads yet?

\ i was using Rails 4.1.7, i think its best if I upgraded back to that

screenshot from 2015-02-07 02 20 59

rgpass commented 9 years ago

Same issue, Ruby 2.1.2, Rails 4.2.0, simple_form 3.1.0.

While this is being resolved, is there a good temporary solution?

albertpak commented 9 years ago

@Niteshvgupta sorry for late response, i didnt, i got into swagger docs, and then ended up using Postman for my local dev

samuelralak commented 9 years ago

@rgpass I use the api_taster gem now. Its pretty covenient

kurenn commented 9 years ago

Try locking out some of the gems to something like:

gem 'compass-rails',  '1.1.7'
gem 'simple_form', '3.0.2'

Let me know how it goes!

jakeatwork commented 9 years ago

I'm going through the API tutorial and just ran into this same issue. I tried locking out the compass and simple_form gems, but there are dependencies that start to fall apart using rails 4.1.4 and ruby 2.1.5.

it looks like it's trying to render a resource named 'inet', but i can't find that anywhere in the gem code or even referenced anywhere on google.

if i take out the following code, the UI renders ok, but it's obviously missing stuff.

<div class="appeareable">
    <% @explorer.resource_columns.each do |column| %>
        <%= f.input column, input_html: {name: "#{@explorer.resource_name}[#{column}]" }, as: @explorer.column_type(column), required: @explorer.required_attribute?(column) %>
    <% end %>
</div>

screen shot 2015-03-29 at 7 15 00 pm

if you want my repo, it's here: http://github.com/jakeatwork/market_place_api

jakeatwork commented 9 years ago

ok...i found a (possible) solution...it appears that rails 4 sets IP addresses as an INET data type in the db. it seems simple_form doesn't know how to render this data type. IPs used to be strings (varchar 255 in postgres) and so converting the db to string for the 2 IP fields in the user table (current_sign_in_ip and last_sign_in_ip) at least let's the UI render, but now it's not displaying the results (though I see the data rendering in the logs). give that a try.

found info on: https://blog.engineyard.com/2013/new-in-rails-4 (ctrl-f for inet)

jakeatwork commented 9 years ago

everything is now working for me now...the json wasn't displaying in the sabisu ui for some reason and i deleted the old marketplaceapi link in ~/.pow and relinked it.

screen shot 2015-03-29 at 11 42 34 pm

if it works for you, please mark my stackoverflow answer as correct if you would be so kind: http://stackoverflow.com/questions/29340177/cant-get-sabisu-gem-to-render-shows-no-input-found-for-inet-error/29340178#29340178

kurenn commented 9 years ago

Great job!, If you could just add the commands to add the migration to make others life easier, that would be sweet! Thanks!

jakeatwork commented 9 years ago

@kurenn thanks...and i updated the answer with the following:

I did this by adding a new migration:

rails g migration change_ip_columns_in_users_table

Then I edited the migration file:

class ChangeIpColumnsInUsersTable < ActiveRecord::Migration
    def change
        change_column :users, :current_sign_in_ip, :string
        change_column :users, :last_sign_in_ip, :string
    end
end
kurenn commented 9 years ago

Sweet, I'll close this issue then! thanks @jakeatwork

jakeatwork commented 9 years ago

from simpleform team - a more simple, and less 'destructive' approach while they figure out if they're going to build in the mapping:

We could simply map them to strings, as I did in this experimental branch some time ago.
Meanwhile you can map those yourself, or pass as: :string on these input fields.

https://github.com/plataformatec/simple_form/issues/1241