[Rails] Re: simple redirect_to shows in log but doesn't redirect

2010-08-05 Thread joshmc...@gmail.com
If the request is getting the correct method which creates comment, then the request is probably working correctly. I usually try to use the create methods for a model in the corresponding controller, so if I create a new comment (even if its originates from the stories view), I simply format my a

[Rails] Re: simple redirect_to shows in log but doesn't redirect

2010-08-04 Thread joshmc...@gmail.com
Just to be clear, this is an ajax request correct? I believe your create method is inside your comments controller, if this is true then by default rails will look for views associated to the methods in the comments controller in comments view folder (/ views/comments/some views). You co

[Rails] Re: simple redirect_to shows in log but doesn't redirect

2010-08-03 Thread joshmc...@gmail.com
The 2 most direct causes I can think of that would produce that error would be: 1. create.js.rjs is not in the correct director (.../app/views/ comments/create.js.rjs 2. create.js.rjs does not exist or bad file name Try using: def create @story = Story.find(params[:story_id]) @story.com

[Rails] Re: simple redirect_to shows in log but doesn't redirect

2010-08-03 Thread joshmc...@gmail.com
Have you tried naming the file create.js.rjs? On Aug 2, 11:46 am, Neil Bye wrote: > Joshua Mckinney wrote: > > From inside your create method in the controller, what does > > request.format return? > > > If the request is a plain old html request is should put "text/html" > > If the request is an

[Rails] Re: simple redirect_to shows in log but doesn't redirect

2010-08-02 Thread joshmc...@gmail.com
>From inside your create method in the controller, what does request.format return? If the request is a plain old html request is should put "text/html" If the request is an ajax request is should put "text/javascript" if the request puts "text/html" or anything besides "text/javascript" you can

[Rails] Re: simple redirect_to shows in log but doesn't redirect

2010-08-02 Thread joshmc...@gmail.com
Check your rjs code. Run debugger and insert <%debugger%> at the very top of the rjs file, if catches the debugger then you have an rjs code error. Install firebug and view the returned javascript. Since the rjs is rendered after the insert your insert would reflect in the log but bad rjs code woul

[Rails] Re: simple redirect_to shows in log but doesn't redirect

2010-08-02 Thread joshmc...@gmail.com
Check your rjs code. Run debugger and insert <%debugger%> at the very top of the rjs file, if catches the debugger then you have an rjs code error. Install firebug and view the returned javascript. Since the rjs is rendered after the insert your insert would reflect in the log but bad rjs code woul

[Rails] Re: Deep beginning

2010-07-20 Thread joshmc...@gmail.com
http://www.tutorialspoint.com/ruby-on-rails-2.1/rails-routes.htm http://guides.rubyonrails.org/getting_started.html see section 4.2 Although its for 2.3, 2.1 looks to be similar. On Jul 20, 5:21 pm, Jan Kadera wrote: > I've got rails 2.1 unfortunately. > Isn't there any more peaceful way to

[Rails] Re: Conditions parameter for find

2010-02-02 Thread joshmc...@gmail.com
You can also use: @dudes = Dude.find(:all, :conditions => {:category_id => category_id}) On Feb 2, 12:28 am, Marnen Laibow-Koser wrote: > Sean Six wrote: > > category_id = params[:category_id] > > > @dudes = Dude.find(:all, > >  :conditions => ["category_id = ?", category_id]) > > > This is retur

[Rails] Re: String to String?

2010-01-13 Thread joshmc...@gmail.com
Thanks guys, was having some issues creating headings based on an array of column names from the DB acquired using User.column_name where "User" is the table. Turns out my problem was unrelated in the link_to codeshould have went to bed sooner. On Jan 13, 1:22 am, siddick wrote

[Rails] String to String?

2010-01-12 Thread joshmc...@gmail.com
Really basic question. How can I convert "this" to 'this' convert from a double quotes string to a single quotes string. -- 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...@googlegrou

[Rails] Allow conditions on multiple tables to be specified using hash.: BUG?

2009-12-08 Thread joshmc...@gmail.com
I'm working with a legacy MSSQL database with non-traditional table names and foreign keys. For our purposes tablel 1 is named 'tblFoo" and table 2 is named "tblBar". I named the models for the before mentioned tables foo.rb and bar.rb, using set_table and set_primary_id. Foo has_many :bars and b