[Rails] ActionView::Template::Error: end of file reached Rails 4.0.4

2014-03-19 Thread Fabio Kreusch
I have an application I'm migrating from Rails 3.2 to 4.0. On my CI environment, I'm getting ActionView::Template::Error: end of file reached randomly in different controller specs pointing to a view in which I have javascript_include_tag 'application'. Has anyone seen this before? Relevant

[Rails] Key Value Json ActiveModel::Errors

2010-09-17 Thread Fabio Kreusch
Hi all, I'm using Rails 3.0, and I have a model which validates if the attribute :name is present. On my my views, I use Jquery to submit the form which creates the model. If the name is not present, Rails returns something like this Json: ['Name is a required value'] Is there a way to make it

[Rails] Re: Json response with belongs_to

2010-04-25 Thread Fabio Kreusch
Anyone? What I want is to inform Rails somehow that the json I want for the comment should also contain information from the Post. On Apr 24, 2:42 pm, Fabio Kreusch fabi...@gmail.com wrote: Hi all, Supponsing I have this: class Post ActiveRecord::Base end class Comment ActiveRecord

[Rails] Json response with belongs_to

2010-04-24 Thread Fabio Kreusch
Hi all, Supponsing I have this: class Post ActiveRecord::Base end class Comment ActiveRecord::Base belongs_to :post end How can I make (on Rails 3) on the CommentsController to respond with a json object including the related Post? Thanks! -- You received this message because you are

[Rails] Re: Rails 3: Update responding with empty json

2010-03-29 Thread Fabio Kreusch
I am still stuck with this. Does anyone knows if this is the expected beavior for Rails? Should respond_with on update really return an empty json object? On Mar 23, 7:17 pm, Fabio Kreusch fabi...@gmail.com wrote: No ideas? On Mar 22, 7:42 pm, FabioKreuschfabi...@gmail.com wrote

[Rails] Re: Rails 3: Update responding with empty json

2010-03-23 Thread Fabio Kreusch
No ideas? On Mar 22, 7:42 pm, Fabio Kreusch fabi...@gmail.com wrote: This is it (HAML): #category-form   - form_for @category, :remote = true do |f|     %fieldset       %legend= t('activerecord.models.category')       %p         = f.label :name         %br         = f.text_field :name

[Rails] Re: Rails 3: Update responding with empty json

2010-03-22 Thread Fabio Kreusch
(val); }); form.attr('action', action); On Mar 22, 2:05 am, Conrad Taylor conra...@gmail.com wrote: On Sun, Mar 21, 2010 at 6:27 PM, Fabio Kreusch fabi...@gmail.com wrote: Hi Conrad, I have tried Rails console, and while trying to convert to json the results were the expected

[Rails] Rails 3: Update responding with empty json

2010-03-21 Thread Fabio Kreusch
Hi all! I'm playing with Rails 3, and on one of my controllers I have the following update method defined: def update @category = @user.categories.find(params[:id]) @category.update_attributes(params[:ecategory]) @category.save respond_with @category end I'm using Jquery to

[Rails] Re: Rails 3: Update responding with empty json

2010-03-21 Thread Fabio Kreusch
Thanks Conrad, I have removed the save call from the code, but it continues to return an empty JSON on success case. Any more clues? On Mar 21, 3:37 pm, Conrad Taylor conra...@gmail.com wrote: On Sun, Mar 21, 2010 at 9:44 AM, Fabio Kreusch fabi...@gmail.com wrote: Hi all! I'm playing

[Rails] Re: Rails 3: Update responding with empty json

2010-03-21 Thread Fabio Kreusch
)  retrieve a category from the user's list of categories c)  convert the result in (b) into json Next, what does the jQuery code look like? -Conrad On Mar 21, 3:37 pm, Conrad Taylor conra...@gmail.com wrote: On Sun, Mar 21, 2010 at 9:44 AM, Fabio Kreusch fabi...@gmail.com wrote

[Rails] Re: Render action inside js template

2009-08-31 Thread Fabio Kreusch
Any thoughts? On Aug 28, 9:30 am, Fabio Kreusch fabi...@gmail.com wrote: Hello all, I'm trying to create the following: There is a index page that lists some items, and 'new item' button. I want the user to be able to click the button, and with ajax the page will be refreshed to show

[Rails] Render action inside js template

2009-08-28 Thread Fabio Kreusch
Hello all, I'm trying to create the following: There is a index page that lists some items, and 'new item' button. I want the user to be able to click the button, and with ajax the page will be refreshed to show the new item form. For that, I added a format.js on my controller, and created a