[Rails] Re: Add a method for approving/disapproving content

2010-03-17 Thread Paul Hepworth
Hey everyone, Hey David, p class=right %= link_to 'Approve', post, :action = 'approve', :id = post % | %= link_to 'Disapprove', post, :action = 'disapprove', :id = post % | %= link_to 'Edit', edit_post_path(post) % | %= link_to 'Delete', post, :confirm = 'Are you sure?', :method = :delete

Re: [Rails] Re: Rails + Mysql

2010-03-17 Thread Conrad Taylor
On Mar 16, 2010, at 6:34 PM, José Luis Romero tangu...@gmail.com wrote: It looks like the gem is already installed, but when i run rake db:migrate I got this error of uninitialized constant MysqlCompat::MysqlRes. this is the output of gem install mysql #sudo gem install mysql --no-ri

[Rails] ActiveRecord::StatementInvalid: Mysql::Error: Lock wait timeout exceeded

2010-03-17 Thread Ram
Hi all, Ive been getting this error on one particular query repeatedly for the past few days. ActiveRecord::StatementInvalid: Mysql::Error: Lock wait timeout exceeded; try restarting transaction: UPDATE `posts` SET `updated_at` = '2010-03-17 05:35:00', `view_count` = 54 WHERE `id` = 158

Re: [Rails] Add a method for approving/disapproving content

2010-03-17 Thread Conrad Taylor
Sent from my iPhone On Mar 16, 2010, at 8:00 PM, David Raffauf li...@ruby-forum.com wrote: Hey everyone, This is my first post to the forums. I'm trying to add an 'approve' and 'disapprove' link for new content to my website. I thought I should just add two links to the show view to

[Rails] Re: refresh a page using AJAX?

2010-03-17 Thread Veena Jose
Hai Robert, Thanks for your help.I have done what you have told me.But the problem is it refreshes only for the first time and shows some RJSerror on the webpage. readings controller def show_current_readings @range=ConfigureParameter.find(:all) if (params[:state] ==) @readings =

[Rails] Re: Add a method for approving/disapproving content

2010-03-17 Thread David Raffauf
Dave, can you post your model file? Thanks Conrad. I found a workaround and got some pointers on how to build the links. I'll report back on the link approach tomorrow. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google

Re: [Rails] Re: refresh a page using AJAX?

2010-03-17 Thread Narendra sisodiya
Hi Veena, You are mentioning :update attribute in the ajax call, so in the responding action you do not need to replace the content of the div. Rails will automatically update it. use following code in your controller render :partial='current_readings_list' or the second solution is just

[Rails] Get lng and lat from Google maps

2010-03-17 Thread Mohammed Alenazi
Hi I am trying to have a google map where the user can click on the map and choose a location. After that, I need to save the lng and lat chosen by the user from the map into the database using rails. What would be the best way to approach that? -- You received this message because you are

[Rails] Re: ActiveRecord::StatementInvalid: Mysql::Error: Lock wait timeout exceeded

2010-03-17 Thread Frederick Cheung
On Mar 17, 6:12 am, Ram yourstruly.vi...@gmail.com wrote: Hi all, Ive been getting this error on one particular query repeatedly for the past few days. ActiveRecord::StatementInvalid: Mysql::Error: Lock wait timeout exceeded; try restarting transaction: UPDATE `posts` SET `updated_at` =

Re: [Rails] Re: refresh a page using AJAX?

2010-03-17 Thread Nitin Rajora
I agree with Naren. Sending name of the div - current_reading as the :update option in the ajax call is enough to automatically replace the contents. No need for explicitly calling replace_html in the action. However if you want to use replace_html in your action... do not send %=

[Rails] Re: Get lng and lat from Google maps

2010-03-17 Thread Brijesh Shah
Use event_id method @map.event_init(@map, :click, function(marker,point) { alert(point); }) point will give u lat long information. For information about google maps in rails: http://blog.brijeshshah.com/google-maps-in-ruby-on-rails/ Thanks Brijesh Shah -- Posted via

[Rails] Re: Re: Before_filters on re-rendered methods - what is the correct RAILS way?

2010-03-17 Thread Sharagoz --
But if you look at the sample code, I did try to call the Create method as well as rendering its template No you didnt. render :action = :create is identical to render :template = 'mycontroller/create'. You might as well comment out the create action, its not getting called at all in your

[Rails] Re: ActiveRecord::StatementInvalid: Mysql::Error: Lock wait timeout exceeded

2010-03-17 Thread Ram
Thanks Fred! I have a staging server where I could deploy this. But I need to reproduce the lockdown. Any hacks that I can use for that? The tables are all quite small and there are no large db queries that could be causing this that I know of. Will crawl through the rails logs and see if I can

[Rails] Re: how to install rails without gems?!

2010-03-17 Thread janita kinsi
well.. thanks for the advice.. :D On Mar 6, 7:03 am, Conrad Taylor conra...@gmail.com wrote: On Tue, Mar 2, 2010 at 12:52 AM, janita kinsi jki...@gmail.com wrote: i have install ruby on my computer. but what if i want to install rails manually without install gem first?! Hi, you'll need to

Re: [Rails] how do you manually specify the name of a submit button?

2010-03-17 Thread Colin Law
On 17 March 2010 03:54, Gordon Yeong anexi...@gmail.com wrote: Thanks craig but my mistake, guys. I meant the id attribute. Hence, we'll get two submit buttons: input id=search_submit name=commit type=submit value=Search / (first form) input id=search_submit name=commit type=submit

Re: [Rails] Re: Re: xss

2010-03-17 Thread Michael Pavling
On 17 March 2010 03:58, Tom Mac li...@ruby-forum.com wrote:         Means we can exempt some fields from sanitization. So isn't that sufficient? Any other thoughts? So instead of messing with *all* of the user-supplied input, you only mess with *some* of it? That won't end up in confusion for

[Rails] Re: actionwebservice broken in production environment

2010-03-17 Thread kikan
Same for me. Here's my log : Action Controller: Exception caught body { background-color: #fff; color: #333; } body, p, ol, ul, td { font-family: verdana, arial, helvetica, sans-serif; font-size: 13px; line-height: 18px; } pre { background-color: #eee; padding: 10px; font-size: 11px; } a { color:

[Rails] Paginator Question

2010-03-17 Thread Newb Newb
Hi i using rails paginator class in my application like below @log_pages = Paginator.new(self, @logs.length, items_per_page, page) i would like to know how can check whether the current page is last page or not? Thank u for any information -- Posted via http://www.ruby-forum.com/. -- You

[Rails] Rails 3 and Haml breaks ERB

2010-03-17 Thread sigvei
I installed rails 3.0 beta and haml 2.2.21 and created a new project, and initalized haml for it. I then generate a standard ERb scaffold (rails scaffold Person name:string) and add gem 'haml' to the Gemfile. When i run the server and head to People#new, I get the following: preundefined method

[Rails] Re: Rails 3 and Haml breaks ERB

2010-03-17 Thread sigvei
On Mar 17, 10:25 am, sigvei sigve.indreg...@gmail.com wrote: I installed rails 3.0 beta and haml 2.2.21 and created a new project, and initalized haml for it. I then generate a standard ERb scaffold (rails scaffold Person name:string) and add gem 'haml' to the Gemfile. rack-mount (0.6.1,

[Rails] Sometimes losing decimal scale on mysql - ok on sqlite

2010-03-17 Thread Owain
I posted this yesterday but it was a bit long-winded: http://groups.google.com/group/rubyonrails-talk/browse_thread/thread/9a6db7467a16911e Here is a more succinct version. Migration generates decimal(8,2) column type ok on sqlite but decimal(10,0) on mysql. So I lose pence and cents on mysql!

[Rails] Re: Paginator Question

2010-03-17 Thread Loganathan Ganesan
Newb Newb wrote: Hi i using rails paginator class in my application like below @log_pages = Paginator.new(self, @logs.length, items_per_page, page) i would like to know how can check whether the current page is last page or not? Thank u for any information It would be useful if you

[Rails] Re: Paginator Question

2010-03-17 Thread Newb Newb
Loganathan Ganesan wrote: Newb Newb wrote: Hi i using rails paginator class in my application like below @log_pages = Paginator.new(self, @logs.length, items_per_page, page) i would like to know how can check whether the current page is last page or not? Thank u for any information

[Rails] Re: ActiveRecord::StatementInvalid: Mysql::Error: Lock wait timeout exceeded

2010-03-17 Thread Frederick Cheung
On Mar 17, 8:39 am, Ram yourstruly.vi...@gmail.com wrote: Thanks Fred! I have a staging server where I could deploy this. But I need to reproduce the lockdown. Any hacks that I can use for that? The tables are all quite small and there are no large db queries that could be causing this

[Rails] REST, Internet Explorer and the banned DELETE method

2010-03-17 Thread Max Williams
Hi all As we all know, in REST the ResourceController#delete action is called by calling /resources/:id with a delete method. But, the delete method is not supported in IE. This seems like a problem to me. How do people get around this, typically? I can think of various ways around it but

[Rails] Re: Re: refresh a page using AJAX?

2010-03-17 Thread Veena Jose
Hai Nitin, Now I have made the following changes in my code.But the page is not refreshing at all.What could be the problem? readings controller def show_current_readings @range=ConfigureParameter.find(:all) if (params[:state] ==) @readings = CurrentReading.find(:all) else

Re: [Rails] how do you manually specify the name of a submit button?

2010-03-17 Thread Gordon Yeong
bravo. another brilliant reply On 17 March 2010 20:12, Colin Law clan...@googlemail.com wrote: On 17 March 2010 03:54, Gordon Yeong anexi...@gmail.com wrote: Thanks craig but my mistake, guys. I meant the id attribute. Hence, we'll get two submit buttons: input id=search_submit

[Rails] Re: REST, Internet Explorer and the banned DELETE method

2010-03-17 Thread DmitryPush
Hi, You just cat you following in your view: %= link_to 'Destroy', photo, :confirm = 'Are you sure?', :method = :delete % and it appear in browser to that: a onclick=if (confirm('Are you sure?')) { var f = document.createElement('form'); f.style.display = 'none'; this.parentNode.appendChild(f);

[Rails] Re: REST, Internet Explorer and the banned DELETE method

2010-03-17 Thread DmitryPush
*your just CAN ADD (sorry for this typo) -- 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 this group, send email to

[Rails] Re: REST, Internet Explorer and the banned DELETE method

2010-03-17 Thread DmitryPush
by the way, the same story about PUT form method=post id=edit_photo_51 class=edit_photo action=/ photos/51 div style=margin: 0pt; padding: 0pt; display: inline; input type=hidden value=put name=_method input type=hidden value=LgNwcxaXQ3+NT95f1SJYo1ZOUfXMFtQimzSzDmjJM3g=

[Rails] Re: REST, Internet Explorer and the banned DELETE method

2010-03-17 Thread Max Williams
DmitryPush wrote: Hi, You just cat you following in your view: %= link_to 'Destroy', photo, :confirm = 'Are you sure?', :method = :delete % and it appear in browser to that: a onclick=if (confirm('Are you sure?')) { var f = document.createElement('form'); f.style.display = 'none';

[Rails] Re: Sometimes losing decimal scale on mysql - ok on sqlite

2010-03-17 Thread Owain
Here are two links that explain that you need to be careful on decimal columns when using mysql on the target platform. sqlite3 is a little more forgiving. http://scottmotte.com/archives/86.html http://blog.coryfoy.com/2008/06/problems-in-rails-between-development-and-test-databases/ I sorted

[Rails] Re: to_xml repeating elements and plain strings

2010-03-17 Thread Harry Wood
I noticed some sections in the Agile Web Developement with Rails book: Autogenerating the XML In the previous examples, we generated the XML responses by hand, using the builder template. That gives us control over the order of the elements returned. But if that order isn’t important, we can

[Rails] Re: Paginator Question

2010-03-17 Thread Loganathan Ganesan
Newb Newb wrote: Loganathan Ganesan wrote: Newb Newb wrote: Hi i using rails paginator class in my application like below @log_pages = Paginator.new(self, @logs.length, items_per_page, page) i would like to know how can check whether the current page is last page or not? Thank u for

Re: [Rails] Re: Re: xss

2010-03-17 Thread Jeremy Chase
Michael, Excellent points. -- Jeremy Chase http://twitter.com/jeremychase On Wed, Mar 17, 2010 at 5:12 AM, Michael Pavling pavl...@gmail.com wrote: On 17 March 2010 03:58, Tom Mac li...@ruby-forum.com wrote: Means we can exempt some fields from sanitization. So isn't that

Re: [Rails] Re: Re: refresh a page using AJAX?

2010-03-17 Thread Bala
Veena, be clear, you want the page to refresh or the div? On Wed, Mar 17, 2010 at 3:55 PM, Veena Jose li...@ruby-forum.com wrote: Hai Nitin, Now I have made the following changes in my code.But the page is not refreshing at all.What could be the problem? readings controller def

[Rails] Re: Re: Re: refresh a page using AJAX?

2010-03-17 Thread Veena Jose
Bala wrote: Veena, be clear, you want the page to refresh or the div? I want only apart of the page to be refreshed which is inside div -- 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

[Rails] Re: Writing a large file with Spreadsheet: very slow, any HELP?

2010-03-17 Thread Joe Peck
Joe Peck wrote: Hey, I'm using the Spreadsheet gem to generate Excel files. It's worked great up until now. I'm trying to put 25,000 rows in a sheet, then doing book.write to write the file. It's really slow, like 3-4 minutes. Is there a way to write groups of rows to a sheet at a

Re: [Rails] Re: Re: Re: refresh a page using AJAX?

2010-03-17 Thread Bala
have you included all necessary js files? which prototype your using for Ajax? copy paste the development.log file On Wed, Mar 17, 2010 at 6:16 PM, Veena Jose li...@ruby-forum.com wrote: Bala wrote: Veena, be clear, you want the page to refresh or the div? I want only apart of the

Re: [Rails] Re: Re: Re: refresh a page using AJAX?

2010-03-17 Thread Bala
and one more thing, please install firebug for firefox if your using, and investigate how it requests the server. On Wed, Mar 17, 2010 at 6:26 PM, Bala bala.mutha...@gmail.com wrote: have you included all necessary js files? which prototype your using for Ajax? copy paste the

[Rails] Re: Using group_to() and aggregation for a simple inventory system @ a field hospital in Haiti

2010-03-17 Thread Clay H.
On Mar 16, 12:45 pm, Michael Pavling pavl...@gmail.com wrote: On 16 March 2010 15:57, Michael Pavling pavl...@gmail.com wrote: Also, is it possible to order the hash so that they appear in descending order of how much of each item is in stock? In other words, sort descending by the value

[Rails] Problem with content-position and background-color in a sidebar

2010-03-17 Thread RichardOnRails
In app\views\expenses\new.html.erb, I’ve got (just so I know where the stuff on the page came from, for now): % content_for :sidebar do % This is my sidebar stuff from:br new.html.erbbr RTS\app\views\expenses % end % In public\stylesheets\style.css, I’ve got: div#sidebar { width:

Re: [Rails] Re: Using group_to() and aggregation for a simple inventory system @ a field hospital in Haiti

2010-03-17 Thread Michael Pavling
On 17 March 2010 13:33, Clay H. cchea...@gmail.com wrote: the only issue is that amount_on_hand is a method in the Medicine model, not in the Stock model -- it performs an aggregate sum for all of the stocks belonging to the medicine in question. This code uses it as a Stock method, doesn't

[Rails] Re: Sometimes losing decimal scale on mysql - ok on sqlite

2010-03-17 Thread RichardOnRails
I'm running mysql 5.0.37 rails 2.3.5 on winxp-pro/sp3 I left off precision and scale on my rails app and found my decimal places missing in the DB. Did a change of that attribute to (10,2) via migration: change_column :expenses, :amount, :decimal, :precision = 10, :scale = 2 and

Re: [Rails] Problem with content-position and background-color in a sidebar

2010-03-17 Thread Colin Law
On 17 March 2010 14:19, RichardOnRails richarddummymailbox58...@uscomputergurus.com wrote: In app\views\expenses\new.html.erb, I’ve got (just so I know where the stuff on the page came from, for now): % content_for :sidebar do %  This is my sidebar stuff from:br    new.html.erbbr    

Re: [Rails] Re: Link as a link AND as a function

2010-03-17 Thread Jeffrey L. Taylor
Quoting Michael Murillo li...@ruby-forum.com: Jeffrey L. Taylor wrote: Quoting Michael Murillo li...@ruby-forum.com: %= link_to_function truncate(article.title, 60), clickThru('#{article.url}','#{article[:id]}', 'click'), :title = article.feed.title, :href = article[:id] %

[Rails] Re: Problem with content-position and background-color in a sidebar

2010-03-17 Thread RichardOnRails
I do have Firebug installed, but keep it inactive until occasions like this arise. Great idea! Thanks, Colin. On Mar 17, 10:43 am, Colin Law clan...@googlemail.com wrote: On 17 March 2010 14:19, RichardOnRails richarddummymailbox58...@uscomputergurus.com wrote: In

[Rails] Re: Recommendations for pdf generators

2010-03-17 Thread Florent2
On 16 mar, 07:56, ct9a anexi...@gmail.com wrote: hi, everyone,   i have googled around for some pdf generators. Found 1) PDF::Writer which is a little dated 2) Rupdf (http://scoop.simplyexcited.co.uk//2007/12/15/rupdf-simple- ruby-pdf-rails-plugin/

Re: [Rails] Problem with content-position and background-color in a sidebar

2010-03-17 Thread Michael Pavling
On 17 March 2010 14:43, Colin Law clan...@googlemail.com wrote: Problem: My page displays the sidebar to the right side as I intend, but: -       It displays the sidebar’s content as intend ... almost: that is, the text appear centered vertically rather than on top -       It continues to

[Rails] Re: Re: Email using ruby on rails

2010-03-17 Thread Manish Belsare
You'll also want to change the address and domain to fit your needs. If you don't know, ask your IT department, or your ISP, or your webhost. Sir for your above mentioned thing well is it necessary to know the domain and address from my ISP?? i cant send an email from my application without

Re: [Rails] Re: Writing a large file with Spreadsheet: very slow, any HELP?

2010-03-17 Thread David Chua
I hope you're sending those tasks to a background worker... On Wed, Mar 17, 2010 at 8:54 PM, Joe Peck li...@ruby-forum.com wrote: Joe Peck wrote: Hey, I'm using the Spreadsheet gem to generate Excel files. It's worked great up until now. I'm trying to put 25,000 rows in a sheet,

[Rails] bundler 0.9.x and rails 2.3.5 problem

2010-03-17 Thread Jessy Glove
Hi all! A simple question to you pros, is it possible to make autoinstall of gems when rails application is run (on mongrel1.1.5)? This was my intention when I today started to look at bundler, but until now it has only proven to me to just be able to install gems from Gemfile manually with

[Rails] Re: Re: Writing a large file with Spreadsheet: very slow, any HELP?

2010-03-17 Thread Joe Peck
David Chua wrote: I hope you're sending those tasks to a background worker... Not yet, but that's probably the route I'll be going. -- 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

[Rails] How do I determine the source action for conditionally rendering error actions and validation messages?

2010-03-17 Thread Clay H.
I have a model called Stock.rb. I created an additional action, called dispense, in the controller so that I could render two different views based on the type of data entry being done. The new action is used for adding stock and the dispense action is used for dispensing stock. They are very

Re: [Rails] How do I determine the source action for conditionally rendering error actions and validation messages?

2010-03-17 Thread Colin Law
On 17 March 2010 15:41, Clay H. cchea...@gmail.com wrote: I have a model called Stock.rb. I created an additional action, called dispense, in the controller so that I could render two different views based on the type of data entry being done. The new action is used for adding stock and the

Re: [Rails] How do I determine the source action for conditionally rendering error actions and validation messages?

2010-03-17 Thread Michael Pavling
On 17 March 2010 15:41, Clay H. cchea...@gmail.com wrote: How do I either: 1) Detect which action/view/template sent the user to the create action, so that I can conditionally return them to the proper action using render? or 2) Use redirect_to(:back) and still show the validation errors?

Re: [Rails] How do I determine the source action for conditionally rendering error actions and validation messages?

2010-03-17 Thread Colin Law
On 17 March 2010 15:55, Michael Pavling pavl...@gmail.com wrote: On 17 March 2010 15:41, Clay H. cchea...@gmail.com wrote: How do I either: 1) Detect which action/view/template sent the user to the create action, so that I can conditionally return them to the proper action using render? or

Re: [Rails] How do I determine the source action for conditionally rendering error actions and validation messages?

2010-03-17 Thread Michael Pavling
On 17 March 2010 16:06, Colin Law clan...@googlemail.com wrote: The RESTful way is to have a dispense_stock controller - which has its own methods. The cheaty (smelly) way is to put a hidden field in the form or an extra querystring parameter with with the value new or dispense, and check

Re: [Rails] Re: Recommendations for pdf generators

2010-03-17 Thread Peter De Berdt
On 17 Mar 2010, at 15:47, Florent2 wrote: i have googled around for some pdf generators. Found 1) PDF::Writer which is a little dated 2) Rupdf (http://scoop.simplyexcited.co.uk//2007/12/15/rupdf-simple- ruby-pdf-rails-plugin/ andhttp://agilewebdevelopment.com/plugins/rupdf) - it's a little

[Rails] Re: Problem with content-position and background-color in a sidebar

2010-03-17 Thread RichardOnRails
Hey Colin and Michael, Thanks to both of you for your responses. Assuming you have div id=sidebar%= yield :sidebar %/div somewhere in your view... [Michael] Sidebar is referenced in three file the app (according to my Ruby Search.rb program): app\views\layouts\standard.html.erb: body

Re: [Rails] Re: Problem with content-position and background-color in a sidebar

2010-03-17 Thread Colin Law
On 17 March 2010 16:52, RichardOnRails richarddummymailbox58...@uscomputergurus.com wrote: Hey Colin and Michael, Thanks to both of you for your responses. Assuming you have div id=sidebar%= yield :sidebar %/div somewhere in your view... [Michael] Sidebar is referenced in three file the

[Rails] Re: Problem with content-position and background-color in a sidebar

2010-03-17 Thread RichardOnRails
Woops, Missed 1 file that mentioned sidebar (because I only searched in files with name matching /erb|rb|rjs/): public\stylesheets\style.css Apologies, Richard On Mar 17, 10:54 am, Michael Pavling pavl...@gmail.com wrote: On 17 March 2010 14:43, Colin Law clan...@googlemail.com wrote:

Re: [Rails] Re: Problem with content-position and background-color in a sidebar

2010-03-17 Thread Colin Law
On 17 March 2010 16:52, RichardOnRails richarddummymailbox58...@uscomputergurus.com wrote: ... app\views\layouts\expenses.html.erb: body    p style=color: green%= flash[:notice] %/p    table width=100%        tr            td  %= yield %              /td            td  %= yield :sidebar %  

[Rails] Re: How do I determine the source action for conditionally rendering error actions and validation messages?

2010-03-17 Thread Clay H.
On Mar 17, 12:06 pm, Colin Law clan...@googlemail.com wrote: On 17 March 2010 15:55, Michael Pavling pavl...@gmail.com wrote: On 17 March 2010 15:41, Clay H. cchea...@gmail.com wrote: How do I either: 1) Detect which action/view/template sent the user to the create action, so that

[Rails] Associating a default paperclip image from a different model

2010-03-17 Thread bingo bob
Here's some code, this is my NewsItem model as you can see... class NewsItem ActiveRecord::Base belongs_to :country has_attached_file :image, :styles = { :original = '57x57' }, :default_url = '/images/football.png' # has_attached_file :image, # :styles = {

Re: [Rails] Associating a default paperclip image from a different model

2010-03-17 Thread Colin Law
On 17 March 2010 17:29, bingo bob li...@ruby-forum.com wrote: Here's some code, this is my NewsItem model as you can see... class NewsItem ActiveRecord::Base  belongs_to :country  has_attached_file :image, :styles = { :original = '57x57' }, :default_url = '/images/football.png'  #  

[Rails] (JOB) Ruby / Erlang Developer (Cape Town, South Africa)

2010-03-17 Thread Your opportunity finder
Opportunity to join an international team of developers. Position based in Cape Town. You will be working with a team of highly skilled and experienced RUBY on RAILS and ERLANG developers on a range of hosted mobile interactive applications. They have rapidly grown over the last five years and

[Rails] Paperclip upload over local network

2010-03-17 Thread @shaan
Hello, I am using the Paperclip plugin in one of my rails applications. It has been working absolutely fine so far on my local PC. Recently, I ported the application onto a LAN. I need the image uploading to be possible over the local network. Are there any changes to be done in paperclip for

[Rails] rails+prawnto: setting :type to :prawn in a #render_to_string call not working

2010-03-17 Thread Kendall Gifford
Hello, my question is rails related though it is also somewhat specific to the prawnto plugin (installed latest version as of 2010-03-15). I would ask on a prawnto forum/list if I knew where one was. Anyhow, I'm using rails 2.3.5 (with ruby 1.8.6 patchlevel 111) in an app that is successfully

[Rails] Avoid web-service delay on an action

2010-03-17 Thread Marcelo de Moraes Serpa
Hello all, In a controller action, there is a call to Twitter's update. While it works as expected, it indoubtedly added some delay to the action processing time. What I would like to do is push this twitter update to another thread or to the background. I know I could use one of the many queue

[Rails] Re: Problem with content-position and background-color in a sidebar

2010-03-17 Thread RichardOnRails
Colin, Is this the div id=sidebar that we are talking about? Yes! Expand the td and select the div id=sidebar that should be there I think. Then you should see the style from style.css *** You're onto something! *** In the Firebug pane, with the 2nd td expanded, when I bring the cursor

[Rails] Re: Problem with content-position and background-color in a sidebar

2010-03-17 Thread RichardOnRails
I don't see where you are putting this in a div with id=sidebar. Should you have % content_for :sidebar do % div id=sidebar This is my sidebar stuff from:br new.html.erbbr RTS\app\views\expenses /div % end % or something similar? Here's

[Rails] Re: Passing a block to gsub

2010-03-17 Thread Dan Paul
Well, I finally figured it out, might as well post it just in case anyone else is trying to do the same thing. Below is the code. # converts @ signs into product links and category links def product_description(product) product.description.gsub(/@(\w+)/m) do |w| if #{$1} =~ /p(.*)/

[Rails] Re: Avoid web-service delay on an action

2010-03-17 Thread Robert Walker
Marcelo de Moraes Serpa wrote: In a controller action, there is a call to Twitter's update. While it works as expected, it indoubtedly added some delay to the action processing time. What I would like to do is push this twitter update to another thread or to the background. I know I

[Rails] Re: Avoid web-service delay on an action

2010-03-17 Thread Robert Walker
Robert Walker wrote: Sound like an excellent use case for delay_job (or similar) to me. Oops. I meant up type delayed_job... -- 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

[Rails] Re: Sometimes losing decimal scale on mysql - ok on sqlite

2010-03-17 Thread Robert Walker
Owain wrote: rake RAILS_ENV=staging db:drop rake RAILS_ENV=staging db:create rake RAILS_ENV=staging db:migrate RichardOnRails wrote: That's easier than the three-stage solution you used, though equivalent in effect I believe. For what it's worth the three-stage solution can be done with one

[Rails] Re: updated rails now missing rails gem

2010-03-17 Thread pmarsh
Yup just wasted a good hour cursing monit and env variables. This was the problem. Rack 1.0.1 works fine with thin so far. On Feb 16, 2:51 pm, Mickael Faivre-Macon li...@ruby-forum.com wrote: Had the same problem. Thank you so much. Mickael. and figured it out. thin can't cope with

Re: [Rails] Re: Problem with content-position and background-color in a sidebar

2010-03-17 Thread Colin Law
On 17 March 2010 19:12, RichardOnRails richarddummymailbox58...@uscomputergurus.com wrote: I don't see where you are putting this in a div with id=sidebar. Should you have         % content_for :sidebar do % div id=sidebar           This is my sidebar stuff from:br             new.html.erbbr

Re: [Rails] Re: updated rails now missing rails gem

2010-03-17 Thread Conrad Taylor
On Tue, Jan 26, 2010 at 12:26 AM, Morgan Morgan li...@ruby-forum.comwrote: Morgan Morgan wrote: Morgan Morgan wrote: So i updated rails and this is now what i'm getting. i tried reinstalling rails and it didn't help. it's installed. this is driving me nuts. i'm at rails 2.3.5 and

[Rails] Rails 3 Routing: Namespace'd Controllers?

2010-03-17 Thread Stefan Buhr
Hi there, I'm stuck with some very simple routing requirements. Somehow I believe this is not even possible with the new Rails 3 Router: So i have my Admin::SettingsController class in controllers/admin My intention is to access the admin-controllers via /admin/:controller/:action in my

[Rails] Re: Problem with content-position and background-color in a sidebar

2010-03-17 Thread RichardOnRails
Thanks Colin for continuing to look at this thing. I posted the only files in my app that have sidebar in their content on http://www.pastie.org/874534. Consecutively, they are: app\views\expenses\new.html.erb app\views\layouts\expenses.html.erb app\views\layouts\standard.html.erb

[Rails] Re: rails+prawnto: setting :type to :prawn in a #render_to_string call not working

2010-03-17 Thread Kendall Gifford
So, if anyone is interested, I made a small, simple rails application that demonstrates what I'm trying to do (sort of), how I'm trying to do it, and how it fails. It has all gems it requires bundled. You just need ruby, rails 2.3.5, and sqlite3 to run it. http://tinyurl.com/ygqvwt4 The real

[Rails] Re: Problem with content-position and background-color in a sidebar

2010-03-17 Thread RichardOnRails
FYI, Here's the model layout I aspire to apply to this app in the next couple of weeks, i.e. after get I over this hurdle, if ever, and probably one or two more: http://www.pastie.org/874611 Right now I'm going to apply the background-color in the html tag; it should take precedence over any CSS

[Rails] Re: Routing problem for Rails 2 newbie

2010-03-17 Thread Kapdi Scom
Restarting the server might do the trick in most cases at the app level, ruby script/server -- 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

[Rails] require behaves differently in Rails vs vanilla Ruby?

2010-03-17 Thread Poco Ritard
I can require a file from the console but not from irb or a simple ruby script. It's not a path issue, the same file is found in both cases. So why is the module namespace an unrecognized constant sometimes and a valid module name others? Same .rb file both times. This one works:

Re: [Rails] Rails 3 Routing: Namespace'd Controllers?

2010-03-17 Thread Conrad Taylor
On Wed, Mar 17, 2010 at 3:14 PM, Stefan Buhr li...@ruby-forum.com wrote: Hi there, I'm stuck with some very simple routing requirements. Somehow I believe this is not even possible with the new Rails 3 Router: So i have my Admin::SettingsController class in controllers/admin My intention

[Rails] Re: require behaves differently in Rails vs vanilla Ruby?

2010-03-17 Thread Frederick Cheung
On Mar 17, 8:56 pm, Poco Ritard chris.abaj...@gmail.com wrote: I can require a file from the console but not from irb or a simple ruby script.  It's not a path issue, the same file is found in both cases.  So why is the module namespace an unrecognized constant sometimes and a valid module

[Rails] Re: Rails 3 Routing: Namespace'd Controllers?

2010-03-17 Thread Stefan Buhr
Conrad Taylor wrote: namespace :admin do resources :settings end Then, you'll end up with the following controllers: /admin/settings Hey, thanks for the hint, but resources() only adds the standard actions to the route (index, show, edit, new, create, update, delete). I'm looking for

[Rails] Re: require behaves differently in Rails vs vanilla Ruby?

2010-03-17 Thread Poco Ritard
Thanks for helping me understand this. I get that lots of stuff gets loaded via the console, it certainly takes longer ;-) Here's what's really puzzling. It seems like the syntax is changing. Could this be an effect of the const_missing hook? For example, I don't even have to load a file. The

Re: [Rails] Re: Rails 3 Routing: Namespace'd Controllers?

2010-03-17 Thread Conrad Taylor
On Wed, Mar 17, 2010 at 4:34 PM, Stefan Buhr li...@ruby-forum.com wrote: Conrad Taylor wrote: namespace :admin do resources :settings end Then, you'll end up with the following controllers: /admin/settings Hey, thanks for the hint, but resources() only adds the standard actions

Re: [Rails] Re: Rails 3 Routing: Namespace'd Controllers?

2010-03-17 Thread Conrad Taylor
On Wed, Mar 17, 2010 at 4:34 PM, Stefan Buhr li...@ruby-forum.com wrote: Conrad Taylor wrote: namespace :admin do resources :settings end Then, you'll end up with the following controllers: /admin/settings Hey, thanks for the hint, but resources() only adds the standard actions

[Rails] Re: Re: Rails 3 Routing: Namespace'd Controllers?

2010-03-17 Thread Stefan Buhr
Conrad Taylor wrote: namespace :admin do resources :settings do get :some_action, :on = :member # member route get :some_other_action, :on = :collection # collection route end end Yes, someone *could* explicitly define all actions in the routes.rb, but that is exactly what I do not want to

[Rails] Re: How do I switch sqlite3 to mysql on RoR

2010-03-17 Thread Mike Montagne
Rick Denatale wrote: This is for an OSX system, some of the details like socket: might be different on Windows. For a new Rails project you can override the default by using the -d mysql option on the rails command. The way I got the above database.yml file was by entering $rails -d

[Rails] SUCCESSFULLY INSTALLING MySQL GEM

2010-03-17 Thread Mike Montagne
Rick Denatale wrote: This is for an OSX system, some of the details like socket: might be different on Windows. For a new Rails project you can override the default by using the -d mysql option on the rails command. The way I got the above database.yml file was by entering $rails -d

[Rails] Re: How do I switch sqlite3 to mysql on RoR

2010-03-17 Thread Mike Montagne
Rick Denatale wrote: On 1/27/08, Phillip Koebbe phillipkoe...@gmail.com wrote: SQLite was made the default in 2.0. They must have just missed the change in the documentation. The default actually changed in 2.0.2

[Rails] Re: How do I switch sqlite3 to mysql on RoR

2010-03-17 Thread Mike Montagne
Rick, Huge thanks for your post. There's a lot of erroneous information which has been extremely misleading on this issue. For the benefit of others who are having FURTHER problems INSTALLING the MySQL gem on their OSX systems, we should clarify that Leopard OSX systems are an exception. If

[Rails] Re: How do I switch sqlite3 to mysql on RoR

2010-03-17 Thread Mike Montagne
Rick, Huge thanks for your post. There's a lot of erroneous information which has been extremely misleading on this issue. For the benefit of others who are having FURTHER problems INSTALLING the MySQL gem on their OSX systems, we should clarify that Leopard OSX systems are an exception. If a

Re: [Rails] Re: How do I switch sqlite3 to mysql on RoR

2010-03-17 Thread Rimantas Liubertas
Funny, right in the database.yml file it says, that on Mac OSX *LEOPARD*, the gem install instruction is: sudo env ARCHFLAGS=-arch i386 gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config Two things: OS X 10.6 is Snow Leopard, OS X 10.5 is Leopard And on Snow Leopard

Re: [Rails] Re: Error running mysql in ror

2010-03-17 Thread Yudi Soesanto
My problem is solved. I reinstall and upgrade mysql and it is working good now. Yudi Soesanto On Mon, Mar 15, 2010 at 7:00 PM, Yudi Soesanto soesa...@gmail.com wrote: I have installed current mysql gem 2.8 I tried these combination but I still get the error * sudo gem install mysql -v 2.7

Re: [Rails] Re: Upgrading rails, ruby and gems

2010-03-17 Thread Yudi Soesanto
Thanks for your help. I reinstall and upgrade mysql and it is working good now. Yudi Soesanto On Tue, Mar 16, 2010 at 2:04 AM, Robert Walker li...@ruby-forum.com wrote: Yudi Soesanto wrote: Hi guys, Is there any good documentation to upgrade rails, ruby and supported gems? I use mac

  1   2   >