[Rails] Re: return JSON in AJAX

2012-06-18 Thread Max Reznichenko
You can also use respond_with method and change your render :json => ActiveSupport::JSON.encode( @return ) to respond_with @return But for using this, you have to specify responds_to :json in controller воскресенье, 17 июня 2012 г., 21:17:32 UTC+3 пользователь Ruby-Forum.com User написал: > >

[Rails] Re: return JSON in AJAX

2012-06-15 Thread Max Reznichenko
Try using basic jquery ajax call i.e. $.ajax({ url : "your_url" // JSON data }).done(function(response) { // here response will have JSON returned by task#create }); пятница, 15 июня 2012 г., 1:45:07 UTC+3 пользователь Ruby-Forum.com User написал: > > hello guys, I'm trying to make a aj

[Rails] Re: How to detect integration tests running ?

2012-06-13 Thread Max Reznichenko
Tests are run as a separate process, not connected to other ones, by default So, using `ps aux | grep` i.e. for linux could help. Anyway, you need OS based solution here среда, 13 июня 2012 г., 14:57:08 UTC+3 пользователь sreid написал: > > How can I detect that test:unit integration tests are be

[Rails] Re: The rails 3 way

2012-06-12 Thread Max Reznichenko
Hi, Steven, Yes it is relevant, but you need to take a look on several key differences between 3.2 and 3.0 version. Asset pipeline i.e. is a major change среда, 13 июня 2012 г., 2:19:44 UTC+3 пользователь BeagleBen написал: > > I am enjoying using rails 3.2 having returned to rails from asp.net

[Rails] Re: how to connect rails app using monodb

2012-06-12 Thread Max Reznichenko
Hi, Checkout Mongoid gem http://mongoid.org/en/mongoid/index.html https://github.com/mongoid/mongoid Max вторник, 12 июня 2012 г., 15:42:31 UTC+3 пользователь honey ruby написал: > > hi all > > i ve installed monodb this is the first time ive installed it and > don't have any idea how to

[Rails] Re: render => partial not recognizing method in call

2012-06-12 Thread Max Reznichenko
Hi, Andrew The error says the @composer variable is not set. By the code I see, that you are setting @composer*s* variable. Take a look at the starting guide on rendering in Ruby on Rails as an approach itself is wrong. Max вторник, 12 июня 2012 г., 15:09:30 UTC+3 пользователь akkdio написал:

[Rails] Re: no such file to load -- rexml/encodings/UTF8.rb

2012-06-12 Thread Max Reznichenko
How do you run the parser? Is it in the Rails app or a single script? Try including rexml directly in (irb or rails)console and post the response четверг, 22 марта 2012 г., 11:04:56 UTC+2 пользователь Ruby-Forum.com User написал: > > I'm install ruby 1.8.7 from rvm on FreeBSD 9 RELEASE, and the

[Rails] Re: weird error in rails 2.3.5

2012-06-12 Thread Max Reznichenko
Try to be more specific with old versions of Rails and change <%= render(@locations) %> to <%= render :partial => "location/location", :collection => @locations %> In this case _location partial should have local variable "location" correctly set. Hope, this helps. MaxR > > Colin, I already trie

[Rails] Re: Rails 3 advanced queries

2012-06-12 Thread Max Reznichenko
Hi, Rashila It looks, that the only good solution here is .where("categories.item_category_id IS NOT NULL") MaxR On 12 июн, 06:44, Rashila Noushad wrote: > In one of my queries I used > .where (:categories => {item_categories {:item_category_id => nil}} for > 'item_category_id IS NULL'. > How t

[Rails] Re: Relations with find_each

2012-06-08 Thread Max Reznichenko
> order.line_items != LineItem.where(:order_id => order.id) Let me rephrase Robert's words. The key difference here is, that LineItem.where(:order_id => order.id) doesn't fire the sql and returns ActiveRecord::Relation object. While the order.line_items runs SQL and returns the Array of records. T

[Rails] Re: how to clean a string from non-html sequences ?

2012-06-08 Thread Max Reznichenko
Probably the best way is to use before_save block in model where u can add attribute_with_html.strip http://ruby-doc.org/core-1.9.3/String.html#method-i-strip On 7 июн, 13:28, Erwin wrote: > using the CKEditor  to enter post content, I get a string as output , > with some escape sequences \r\n\

[Rails] Re: Ruby on rails with twitter integration

2011-10-23 Thread Max Reznichenko
Hi, amvis, Isn't it an error of just wrong username/password? -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com. To unsubscribe from this group, send email to rubyonra

[Rails] Re: what does :new => {:start => :get} mean in routes?

2011-04-27 Thread Max Reznichenko
ure what this is doing. > > The sessions controller has these two methods: > >   def new >     redirect_to start_new_session_path and return if current_user >     flash.now[:alert] = params[:error] if params[:error] >     flash.now[:notice] = params[:notice] if params[:notice]

[Rails] Re: Re: ActiveRecord::Relation issue

2010-10-18 Thread Max Reznichenko
d', :joins => {:tasklists => :tasks}, :conditions => "tasks.status = 'open'") end end And now the call User.first.projects.active returns all the projects with active tasks. Max Reznichenko -- Posted via http://www.ruby-forum.com/. -- You received this message because

[Rails] Re: ActiveRecord::Relation issue

2010-10-16 Thread Max Reznichenko
_c, :through => :model_b Max Reznichenko -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe from t

[Rails] ActiveRecord::Relation issue

2010-10-15 Thread Max Reznichenko
e any possibility to call in controller just active_projects = Project.all.active. I would appreciate any help. Max Reznichenko -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. T