Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wrong number of arguments (4 for 0) #26

Open
kulakowka opened this issue Feb 22, 2014 · 11 comments
Open

wrong number of arguments (4 for 0) #26

kulakowka opened this issue Feb 22, 2014 · 11 comments

Comments

@kulakowka
Copy link

I use manual: https://github.com/madebymany/sir-trevor-rails

My gemfile i add:
gem 'sir-trevor-rails', github: 'madebymany/sir-trevor-rails', branch: 'v4'

But i have error:

ArgumentError in Posts#new
Showing .../app/views/posts/_form.html.haml where line #18 raised:

wrong number of arguments (4 for 0)
Extracted source (around line #18):

In _form.html.haml i write:

= form_for @post, url: url_for(@post) do |f| 
   = f.sir_trevor_text_area :body

Model have attribute :body

When has be error ???

P.S.
$ rails -v

Rails 4.0.0

@sibsfinx
Copy link

I get same error when using f.sir_trevor_text_area in Active Admin

@Fudoshiki
Copy link

wrong number of arguments (4 for 0)
ruby 2.0
rails 4.0.4

@ninjabiscuit
Copy link
Contributor

Hi guys.

Try this branch of the gem: https://github.com/madebymany/sir-trevor-rails/tree/redesign-gem

There are some changes that you will need to make but in the long run it should make ST integration easier as it removes the need for sir_trevor_text_area. Plus I've been using it with Rails 4 ruby 2 on a number of apps so should work there.

I'm just trying to find the time to write some test before I PR it to master.

Let me know if you have any problems

@Fudoshiki
Copy link

gem 'sir_trevor_rails'
Could not find gem 'sir_trevor_rails (>= 0) x64-mingw32' in the gems available

gem 'sir_trevor_rails', github: 'madebymany/sir-trevor-rails', branch: 'redesign-gem'
work but

rails s
C:/Ruby200-x64/lib/ruby/gems/2.0.0/bundler/gems/sir-trevor-rails-0b6fb9a7f458/lib/sir_trevor_rails/view_resolver.rb:2:in
`module:SirTrevorRails': uninitialized constant ActionView::FileSystemResolver (NameError)

@Fudoshiki
Copy link

can you upload working example with sir trevor on rails?

@tomgrim
Copy link

tomgrim commented May 20, 2014

+1

Rails: 4.0.4
Ruby 2.1.1

Can't even try @ninjabiscuit s branch as I get this error:

Could not find gem 'sir-trevor-rails (>= 0) ruby' in https://github.com/madebymany/sir-trevor-rails.git (at redesign-gem).

@ninjabiscuit
Copy link
Contributor

@tomgrim for some (stupid) reason, I renamed the gem to be sir_trevor_rails (note the underscores) for consistency. try it again by referencing the the correct name in the gemfile

@tomgrim
Copy link

tomgrim commented May 20, 2014

Ah good catch! Unfortunately I'm now getting:

undefined method 'sir_trevor_text_area' for #<Formtastic::...

I see someone else fixed this by restarting their server but I haven't had the same luck.

@ninjabiscuit
Copy link
Contributor

Yeah, I need to write an upgrade guide for this gem I guess.

I've removed the sir_trevor_text_area helper (as well as a bunch of other helpers too)

Most of the breaking changes are mentioned here: https://github.com/madebymany/sir-trevor-rails/blob/redesign-gem/README.md

to fix that error, you'll need to manually set up a textarea for use with sir trevor. IE use a normal textarea_tag with a class that you can reference from your JS when you instantiate ST.

I'll try and put together a guide at some point.

@tomgrim
Copy link

tomgrim commented May 20, 2014

Should really have read the commits before posting but at least it's working now! Thanks a lot for your help 👍

@ninjabiscuit
Copy link
Contributor

No problem, glad you got it working. You've spurred me on to finish the documentation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants