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

ActionView::Template::Error in production with Rails 4 #20

Open
OlegPasko opened this issue Nov 15, 2013 · 5 comments
Open

ActionView::Template::Error in production with Rails 4 #20

OlegPasko opened this issue Nov 15, 2013 · 5 comments

Comments

@OlegPasko
Copy link

Using sir-trevor-rails with fix by @maxmcd (https://github.com/maxmcd/sir-trevor-rails).
Working well in development, but in production I have

ActionView::Template::Error (undefined method `sir_trevor_text_area' for #<ActionView::Helpers::FormBuilder:0x000000041c7858>):
44:     </div>
45:     <div class="form-group">
46:       <%= f.label :content %>
47:       <%= f.sir_trevor_text_area :content, rows: 10, class: 'form-control' %>
48:     </div>
49:     <div class="form-group">
50:       <%= f.label :tag_list %>
  app/views/posts/_form.html.erb:47:in `block in _app_views_posts__form_html_erb___2074943611839989041_30498540'
  app/views/posts/_form.html.erb:1:in `_app_views_posts__form_html_erb___2074943611839989041_30498540'
  app/views/posts/new.html.erb:9:in `_app_views_posts_new_html_erb___4056126361373820737_32457920'

What can I miss?

@maxmcd
Copy link

maxmcd commented Nov 16, 2013

My fix is pretty hacky. Hopefully someone from the madebymany team will come along and clean it up. I'm not specifically sure what's wrong with your code, everything's working for me in production. One correction though:
<%= f.sir_trevor_text_area :json_body, input_html: {} %>
This is how you add html addtributes. So for you it would be: <%= f.sir_trevor_text_area :content, input_html: {rows: 10, class: 'form-control'} %>
You also really don't need the rows and class attributes though as sir-trevor hides the textarea.

edit: also, let me know if you're just using the pull request, or my fork, they are slightly different, I can only confirm that my comments work for my fork

@OlegPasko
Copy link
Author

Oops, html is atavism from text_input. I'm using your fork.
Maybe it is another problem... I'm using gem without require 'sir-trevor-rails' in application controller, it works nice in development. When I use require, it is an error with Unicorn in production appears.

Thanks.

@OlegPasko
Copy link
Author

It is problem in Unicorn.
I just needed to stop and start (not restart) server :)

@OlegPasko
Copy link
Author

@maxmcd
Copy link

maxmcd commented Nov 20, 2013

@OlegPasko That's from an older version of sir-trevor.js, it looks like they were planning on including galleries and then dropped the functionality. The newest version of the library doesn't have any reference to galleries.

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

2 participants