Re: [Rails] What does "require tree" do in Rails 3.1?

2011-07-18 Thread rajeevsharma86
The first three requires bring in the files in vendor/assets/javascripts, while the lastrequire_tree . tells sprockets to require everything in the same directory. The require order is alphabetical, so you may have to move things around or be more specific to correctly get your dependencies in orde

[Rails] What does "require tree" do in Rails 3.1?

2011-07-18 Thread David Zhang
In Rails 3.1 This is my application.css: /* *= require_self *= require_tree . */ This is my application.js: //= require jquery //= require jquery_ujs //= require jquery-ui //= require_tree . What does the "require_tree ." do? -- You received this message because you are subscribed to th

Re: [Rails] Re: error of testing redirect in controller

2011-07-18 Thread Chirag Singhal
You may also want to read through Rails guides on testing - http://guides.rubyonrails.org/testing.html#functional-tests-for-your-controllers Chirag http://sumeruonrails.com On Tue, Jul 19, 2011 at 9:34 AM, Chirag Singhal wrote: > Your test can be something like this: > > post :create, :user =>

[Rails] Re: Difficulty figuring out this model association..

2011-07-18 Thread Andrew Skegg
Joshua Kappers writes: > > Essentially, I want to achieve something like this: > http://pastie.org/private/0yuhxeqyheqov3pzkhnga > > Item model that can contain many Items that are required to create that > Item. > > I'm new to rails, and having a hard time figuring out how to make this > happ

Re: [Rails] Re: error of testing redirect in controller

2011-07-18 Thread Chirag Singhal
Your test can be something like this: post :create, :user => {:email => "test_em...@mail.com", :password => "12345", :name => "you"} response.should redirect_to('confirm') Chirag http://sumeruonrails.com On Mon, Jul 18, 2011 at 7:38 PM, Yennie wrote: > > > On Jul 18, 9:57 am, Chirag Singha

[Rails] Difficulty figuring out this model association..

2011-07-18 Thread Joshua Kappers
Essentially, I want to achieve something like this: http://pastie.org/private/0yuhxeqyheqov3pzkhnga Item model that can contain many Items that are required to create that Item. I'm new to rails, and having a hard time figuring out how to make this happen. Any guidance, is greatly appreciated. -

[Rails] Re: Restful Users

2011-07-18 Thread Andrew Skegg
Tyrel R. writes: > > Sorry its hard to phrase this question > > My user controller is a restful resource so get user shows the profile > page that all users access. I was wondering where to code the control > panel users see when the log in. > Which model(s) does the user's control panel pu

[Rails] Re: Printing nested data to screen

2011-07-18 Thread Andrew Skegg
Barney writes: > > > Skill > <%= @people_skill.build.skill %> > <%= PeopleSkill.where("people_id = @person.id")%> > > > which produced the strange # guesses have either given me errors or no output at all, so please > tell me the right way to do this. > Barney > PeopleS

[Rails] Re: Restful Users

2011-07-18 Thread Tyrel R.
Sorry its hard to phrase this question My user controller is a restful resource so get user shows the profile page that all users access. I was wondering where to code the control panel users see when the log in. -- Posted via http://www.ruby-forum.com/. -- You received this message because

[Rails] Printing nested data to screen

2011-07-18 Thread Barney
I have a table called people_skills linked to a people table by a FK named people_id. Trying to get the people_skills fields printed on a "Show" screen has never given me what I wanted (the field value) without resorting to a helper which forms an input box. The people table's values are printed

Re: [Rails] Restful Users

2011-07-18 Thread John Feminella
Isn't that just the `GET /users` path? ~ jf -- John Feminella Principal Consultant, BitsBuilder LI: http://www.linkedin.com/in/johnxf SO: http://stackoverflow.com/users/75170/ On Mon, Jul 18, 2011 at 21:12, Tyrel R. wrote: > I just finished my authentication for my user model and session > con

[Rails] Restful Users

2011-07-18 Thread Tyrel R.
I just finished my authentication for my user model and session controller and a question popped into my head. I do want to stay restful and I don't know where to put my user control panel. I mean its not really a show user thing. I could have a hole new controller and views for the user control pa

[Rails] Using blocks in erb / abingo

2011-07-18 Thread bertly_the_coder
Hi guys, I'm using abingo to a/b test on my website. I have a buttong that I would like to test with different words. Currently I have the test set up like so: <% ab_test("signup_test", ["START YOUR MEMBERSHIP","SIGN UP", "CLICK HERE"]) do |button_text| %> <%= button_to button_text, :new_user_re

[Rails] Re: Warnings in rails installation

2011-07-18 Thread Andrew Skegg
Artful writes: > > I tried installing rubygems 1.8.5 and for the most part everything > went as expected, but I received two Warnings and one Message: > > Fetching: builder-2.1.2.gem (100%) > WARNING: builder-2.1.2 has an invalid nil value for @cert_chain > > Fetching: abstract-1.0.0.gem (100%

[Rails] Re: sqlite problem

2011-07-18 Thread Aegorov Egorov
1 Thank you!it's help me. I guess that this is the problem. Hassan Schroeder wrote in post #1011501: > On Mon, Jul 18, 2011 at 3:04 PM, Aegorov Egorov > wrote: > >> SQLite3::SQLException: near "to": syntax error: SELECT COUNT(*) FROM >> "likes" WHERE ("likes".to = 1) >> in sqlite console sql que

[Rails] Re: Rails JS best practices? (jQuery + Prototype / MooTools

2011-07-18 Thread Alexey Petrushin
Hmm, I mean to integrate it a little differently, without using jQuery safe mode. Usually You also needs a lots of plugins that works with jQuery, and some of them probably will not work in safe mode. There should be no conflict and functional duplication, I suggested to include only the 'lang.

Re: [Rails] sqlite problem

2011-07-18 Thread Hassan Schroeder
On Mon, Jul 18, 2011 at 3:04 PM, Aegorov Egorov wrote: > SQLite3::SQLException: near "to": syntax error: SELECT COUNT(*) FROM > "likes" WHERE ("likes".to = 1) > in  sqlite console sql query working with this syntax > SELECT COUNT(*) FROM "likes" WHERE ("likes"."to" = 1) Apparently the SQLite3 ad

[Rails] sqlite problem

2011-07-18 Thread Aegorov Egorov
Hello! I have a rails app using a mysql. Now I need to configure it with sqlite. I change database settings in config/database.yml and Gemfile file and run rake db:create rake db:migrate and did not get any errors. But in view a have a code <%=@user.likes.size%> and get error SQLite3::SQLExcept

Re: [Rails] display image

2011-07-18 Thread Hassan Schroeder
On Mon, Jul 18, 2011 at 10:44 AM, Angelo Cordova wrote: > I'm using paperclip for uploading images in the public folder, but > when I want to show the images I have to use rmagick. No you don't. The whole purpose of rmagick/ImageMagick in the context of uploading is to enable resizing of too-lar

[Rails] Re: Ruby variable that embeds html tags

2011-07-18 Thread Robert Walker
Colin Law wrote in post #1011094: > On 15 July 2011 22:13, Jacob wrote: >> of every required line. I'd like instead to use a variable: >> >> <% req = "Required field" %> >> >> And then have >> <%= f.text_field :screen_name %> <%= req %> > > By default Rails will assume that req may contain malicio

[Rails] Re: Serialize Nested Hash Problem!

2011-07-18 Thread Frederick Cheung
On Jul 18, 9:09 am, cipher_neo wrote: > > I am not sure what gems are actually used in building the params hash or > when using the "serialize" call, could you shed some light on that and maybe > I can pin point what gem exactly is at the wrong version? some combination of the rack and rails gems

[Rails] Re: rails server being aborted due to mysql lib file not available

2011-07-18 Thread Frederick Cheung
On Jul 18, 7:29 pm, nisha wrote: > Hi, > > My system has the following : > > MacOs Leopard > Rails 3 > Ruby 1.9 > Mysql 5.1.58 > mysql2 ruby gems > > I have tried all the suggested methods, without any success., > The .bash_profile file is updated to contain the DYLIB in the path. > > The proble

[Rails] gtalk

2011-07-18 Thread patrick lacambacal
hi, How can i put gtalk into my application. Im using ruby on rails. thanks, patrick -- 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,

[Rails] display image

2011-07-18 Thread Angelo Cordova
Hello everyone I'm new in Ror and I have a problem with image display. I'm using paperclip for uploading images in the public folder, but when I want to show the images I have to use rmagick. Rmagick depends on Imagemagick, and the owner of the project doesn want to install Imagemagick. so I can'

[Rails] Re: Ruby on Rail freelance developers needed

2011-07-18 Thread kristof leroux
Can you work from home ? On Jul 17, 3:59 pm, Artur wrote: > Hi, > > Please provide me with an additional information by > artur.belya...@gmail.com > > On Jul 16, 1:05 am, Ale wrote: > > > > > > > > > HI all, > > thanks for creating this chat! > > > I have a small internet start up and looking fo

Re: [Rails] Re: Rails JS best practices? (jQuery + Prototype / MooTools

2011-07-18 Thread Walter Lee Davis
It's generally not a good idea to use two large libraries like this in the same page. Not only do they conflict (unless you use the jQuery.noConflict() patch to rewrite any uses of the $ function defined in Prototype) but they each do more or less the same thing, so it's a waste to force a

[Rails] error of render

2011-07-18 Thread Yennie
Hi I test "simple"> response.should render_template("home_simple") How can i test the < render "home" > response.should render_template("home") it gives me error as : expecting <"home"> but rendering with <"">. def home if !current_user render

[Rails] rails server being aborted due to mysql lib file not available

2011-07-18 Thread nisha
Hi, My system has the following : MacOs Leopard Rails 3 Ruby 1.9 Mysql 5.1.58 mysql2 ruby gems My problem is that when i give "rails server", the task aborts with the foll error rails server/Users/nisha/.rvm/gems/ruby-1.9.2-p180@rails3/gems/ railties-3.0.5/lib/rails/script_rails_loader.rb:11: w

[Rails] error of redirect page (Controller Test)

2011-07-18 Thread Yennie
Hi, I have a trouble of testing controller with redirect to the confirm page I dont understand why i can pass the render the template new but not to redirect the confirm please help in browser the link is http://0.0.0.0:3000/register_confirm def create @user = User.new(params[:user])

[Rails] Re: refreshing multiple activerecord objects referring to same database record

2011-07-18 Thread sreid
I just used childs to show it was the plural. Would rails pluralize child to children ? All the attributes match correct in both cases - including parent_id - but not parent. I assume the parent object is not a real attribute, as only parent_id is shown when I do an inspect. -- You received this

Re: [Rails] Re: refreshing multiple activerecord objects referring to same database record

2011-07-18 Thread Jim Ruther Nill
On Mon, Jul 18, 2011 at 10:47 PM, sreid wrote: > My problem occurs when trying to modify a parent record from a child, > using an after_create callback in the child is created (they have a > has_many / belongs_to association). > > After some more testing (checking object ids), I can get a test to

[Rails] Re: modify default gemset for new projects

2011-07-18 Thread Robert Walker
Juan Alvarado wrote in post #1011279: > I have a standard set of gems ( gems like rspec and factory_girl for > example) which in most cases always get added to a project and I was > wondering if anyone could point me in the right direction for an easy > way to customize the rails new generator to i

[Rails] Re: refreshing multiple activerecord objects referring to same database record

2011-07-18 Thread sreid
My problem occurs when trying to modify a parent record from a child, using an after_create callback in the child is created (they have a has_many / belongs_to association). After some more testing (checking object ids), I can get a test to pass if I use (e.g.) : 1) Child.create(:parent => parent

[Rails] Re: error of testing redirect in controller

2011-07-18 Thread Yennie
On Jul 18, 9:57 am, Chirag Singhal wrote: > You have to send params along with call to post. > Since there are no params in post, it goes to the else section of you > controller, where you render a action, and response code for render is 200. > So the test fails saying that you expected a redire

[Rails] rails_admin & carrierwave

2011-07-18 Thread Tin Gimranov
Hi to all Please help me =( I use rails_admin and I need to upload files with the help of it. I found carrierwave for it and installed it with the help of https://gist.github.com/884835. But It doesn't work =( when i login in rails_admit? i see default text field instead field for choose a file

Re: [Rails] error of testing redirect in controller

2011-07-18 Thread Chirag Singhal
You have to send params along with call to post. Since there are no params in post, it goes to the else section of you controller, where you render a action, and response code for render is 200. So the test fails saying that you expected a redirect but got render. Chirag http://sumeruonrails.com

[Rails] error of testing redirect in controller

2011-07-18 Thread Yennie
Hi, I want to test the user controller, how can i do the code is if @user.save redirect_to :action => "confirm" else . test user = User.new(:email => "b...@mail.com", :password => "12345", :name => "you") post :create user.should_re

[Rails] Railties config.time_zone

2011-07-18 Thread Michael Rigart
Hi, I have stumbled upon a small issue regarding the use of Railties (Engine) and setting the time_zone. It seems when I set the time_zone in my engine like: class Engine < Rails::Engine config.time_zone = 'Brussels' end The actual time zone in the application is set back to the default 'U

Re: [Rails] Re: Rack::Bug for Rails 2.2.1

2011-07-18 Thread Hassan Schroeder
On Mon, Jul 18, 2011 at 12:44 AM, cipher_neo wrote: > I have done a quick search on footnotes, but still not quite sure what > exactly it provides except for links back to the code? > Are you saying it could be used alongside newrelic? The information provided is similar, but no, there's probabl

Re: [Rails] Re: spork error: Gem::LoadError

2011-07-18 Thread David Chelimsky
On Jul 18, 2011, at 1:27 AM, 7stud -- wrote: > Conrad Taylor wrote in post #1011293: >> On Sat, Jul 16, 2011 at 4:34 AM, 7stud -- wrote: >> >>> versions back to the old versions, but now I get that spork error. Is >>> there a way to 'unactivate' spork 0.9.0 and 'activate' spork 0.8.4? >>> >>>

[Rails] Eager Loading with scoping

2011-07-18 Thread jayandra
I have been trying to eager load associations based on some scope in my rails3 app, but could not find any solution. My app has following models: class Project has_many :entries has_many :to_dos class ToDo has_may :entries has_many :tasks belongs_to :project

[Rails] Mailer multiparts order , :parts_order doing nothin ..

2011-07-18 Thread Erwin
I am sending multiparts emails ( html and plain text ) , I wrote as default : default :from => Rails.configuration.no_reply_address, :parts_order => ["text/html", "text/enriched", "text/plain" ] and each email is generated with the 2 formats : mail(:to => @sender, :subject => "#{I18n.t(

[Rails] [gem] Rails Exception Handler released

2011-07-18 Thread Sharagoz
Hi I just released a gem called "Rails Exception handler" for Rails 3. It gives you: - An easy way of gathering error reports from all your rails 3 apps in one database - Customized responses that are rendered within the applications layout file - Fine grained control over which exceptions shou

Re: [Rails] Re: refreshing multiple activerecord objects referring to same database record

2011-07-18 Thread Colin Law
On 18 July 2011 09:29, Colin Law wrote: > On 18 July 2011 09:01, Jim Ruther Nill wrote: >> >> >> On Mon, Jul 18, 2011 at 3:48 PM, sreid wrote: >>> >>> Is there some way to get a list of the existing instances which refer >>> to the record ? >>> >> >> I think there's none. >> >>> >>> Would upgrad

Re: [Rails] Re: refreshing multiple activerecord objects referring to same database record

2011-07-18 Thread Colin Law
On 18 July 2011 09:01, Jim Ruther Nill wrote: > > > On Mon, Jul 18, 2011 at 3:48 PM, sreid wrote: >> >> Is there some way to get a list of the existing instances which refer >> to the record ? >> > > I think there's none. > >> >> Would upgrading to 3.1 and enabling identity map solve the problem

[Rails] Re: Serialize Nested Hash Problem!

2011-07-18 Thread cipher_neo
Hi Fred, thanks for your feedback. Yes, the data contained in the subhash (table_order_data) comes directly from the params hash. In which case I am not in control of how that hash is built. This leads me to think that it has got something to do with how the params hash is constructed, rather

Re: [Rails] Re: refreshing multiple activerecord objects referring to same database record

2011-07-18 Thread Jim Ruther Nill
On Mon, Jul 18, 2011 at 3:48 PM, sreid wrote: > Is there some way to get a list of the existing instances which refer > to the record ? > > I think there's none. > Would upgrading to 3.1 and enabling identity map solve the problem ? > > Sorry, I haven't looked at 3.1 yet so I have no clue. >

[Rails] Re: refreshing multiple activerecord objects referring to same database record

2011-07-18 Thread sreid
Is there some way to get a list of the existing instances which refer to the record ? Would upgrading to 3.1 and enabling identity map solve the problem ? -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email

Re: [Rails] Re: Rack::Bug for Rails 2.2.1

2011-07-18 Thread cipher_neo
I have set up newrelic rpm and it is exactly what I was looking for. Really in depth info about what is goin on in the code. It has helped to me to find some places in the code that needed some tweaking and has helped reduce average response times. I have done a quick search on footnotes, but

Re: [Rails] Re: What's a good alternative to Uploadify?

2011-07-18 Thread Jim Ruther Nill
On Mon, Jul 18, 2011 at 2:58 PM, Jim wrote: > Thanks. I'm testing it out now. > > Unfortunately passenger/nginx 3.0.2 seems to be throwing exceptions > and returning 502 if the file is large, over 100KB. Hopefully a new > version will resolve that. > > 100kb isn't large. I don't know what the d