[Rails] Run ruby web app from command line

2012-10-01 Thread Sta Canovist
Hello I made a quite simple ruby web app. It uses scrubyt and mysql to store results as cached results. The program is quite simple. It shows a form, you enter a value and the controller makes an external http call, parse the data and show the result for the user. But I have a problem. I have

Re: [Rails] Routing issue

2011-06-15 Thread Sta Canovist
2011/6/14 Walter Davis wa...@wdstudio.com There's the nut of the problem right there. You don't ever want to POST to the 'edit' route. You want to POST to the 'update' route. So if your curl application is already aware of the format of the element you're updating, all you need to do is POST

Re: [Rails] Routing issue

2011-06-15 Thread Sta Canovist
2011/6/15 Colin Law clan...@googlemail.com What does rake routes show? Is the url you are using above contained there? Colin Well, among those that I think are relevent I can only see: portal_update POST /admin/accounts/:account_id/portals/:portal_id/update(.:format) {:action=update,

Re: [Rails] Routing issue

2011-06-15 Thread Sta Canovist
2011/6/15 Sta Canovist stacanov...@gmail.com 2011/6/15 Colin Law clan...@googlemail.com Well, among those that I think are relevent I can only see: portal_update POST /admin/accounts/:account_id/portals/:portal_id/update(.:format) {:action=update, :controller=admin/portals} PUT

Re: [Rails] Routing issue

2011-06-15 Thread Sta Canovist
2011/6/15 Colin Law clan...@googlemail.com Right, so you can see that the routes you want are not there. As you can see, the update route requires an id for the portal, so it knows which portal to update, and you have not provided that in your url. Colin Are you sure? I see that I send

Re: [Rails] Routing issue

2011-06-15 Thread Sta Canovist
2011/6/15 Sta Canovist stacanov...@gmail.com Are you sure? I see that I send the ID both for get and post. With GET i put this in the browser: http://localhost:3000/admin/accounts/133/portals/update And the log shows that I requested a GET, and there are no routes error. But from CURL I

[Rails] Routing issue

2011-06-14 Thread Sta Canovist
Hello I have this in my route.rb namespace :admin do resources :accounts do resources :portals do post 'create' post 'edit' post 'show' end end end Actually, from the beginning it looked like this: namespace :admin do resources :accounts do

Re: [Rails] Routing issue

2011-06-14 Thread Sta Canovist
2011/6/14 Walter Davis wa...@wdstudio.com What do you see when you type rake routes (from inside your project root) in your terminal? Well, I get an error sigh: rake aborted! You have already activated rake 0.9.1, but your Gemfile requires rake 0.8.7. Consider using bundle exec.

Re: [Rails] Routing issue

2011-06-14 Thread Sta Canovist
2011/6/14 Walter Davis wa...@wdstudio.com Cue Mythbusters theme music: Well, there's your problem right there... Ok, running bundle exec rake routes solves the problem. Now I can see all the routes. There are a lot. Those related to my problem are: portal_edit POST

Re: [Rails] Routing issue

2011-06-14 Thread Sta Canovist
2011/6/14 Walter Davis wa...@wdstudio.com This looks like the path you want to post your form results to, but if this is a POST, you should be hitting :action = 'update' rather than 'edit'. To load the form that you will fill with new data for your update, you would have a matching route

[Rails] Basic database question

2011-06-09 Thread Sta Canovist
Hi there Yes, I know very little of ruby. I must take a crash course? Probabily. Anyway, I try to ask this here. I have a control: customer_controller. From here, I can do something like: @id = 1 @customer = Customer.find(id) Now @customer will contain all the fetched record for customer with

[Rails] Re: Basic database question

2011-06-09 Thread Sta Canovist
On Jun 9, 9:42 am, Colin Law clan...@googlemail.com wrote: Work through the rails tutorial at railstutorial.org which is free to use online.  Even though it may appear that this app is not similar to what you want to write you will learn a great deal. Thanks I will. -- You received this

[Rails] New added function in vendor modue unrecognized

2011-06-09 Thread Sta Canovist
Hello My controller creates an instance of a module class. The module resides into the /vendor folder. /vendor/plugins/my_client/lib/client.rb This class, or all this app, has been done by someone that apparently know much more about ruby than me. As long as I make changes inside this class,

[Rails] Re: New added function in vendor modue unrecognized

2011-06-09 Thread Sta Canovist
On Jun 9, 12:18 pm, Sta Canovist stacanov...@gmail.com wrote: Hello Oh well, solved. I needed to restart WEBrick. I need to do it each time I make changes in modules! -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post

[Rails] Re: Stupid newbie question

2011-06-04 Thread Sta Canovist
Hello guys So, finally I make it work. For those that could experience same problem as me, I can tell how I did. I have a mac 10.5.8 Preinstalled was ruby 1.8.6 and rails version 1.something. Tried different ways but none worked (macports, rvm, locomotive etc). But on the ruby site there is a one

[Rails] Re: Stupid newbie question

2011-06-03 Thread Sta Canovist
On Jun 2, 5:58 pm, Hassan Schroeder hassan.schroe...@gmail.com wrote: Probably trivial to fix -- do you have all the XCode developer stuff on your system(s)? In any case... Well, I guess it was not so trivial. In short: I have been trying to run either through passenger or webrick.

[Rails] Re: Stupid newbie question

2011-06-03 Thread Sta Canovist
On Jun 3, 6:25 pm, Martin Wawrusch mar...@wawrusch.com wrote: RVM to the rescue I guess: Go here:  https://rvm.beginrescueend.com/ install it, then go tohttp://rubygems.org/ and install rubygems (might actually be installed with rvm, you need to check this). Isnt there an easier way? I have

[Rails] Re: Stupid newbie question

2011-06-03 Thread Sta Canovist
On Jun 3, 6:48 pm, Martin Wawrusch mar...@wawrusch.com wrote: It is ONE line copy and pasted into your shell and really the recommended way to use Ruby on the Mac. It does not get much simpler than this. Ok IN that case I will give it a try. Thanks. -- You received this message because you

[Rails] Re: Stupid newbie question

2011-06-03 Thread Sta Canovist
On Jun 3, 6:54 pm, Hassan Schroeder hassan.schroe...@gmail.com wrote: You seem to be mixing up commands between Rails 2.x and 3.x. Which do you have installed? Or more to the point, what is the app you're trying to run based on? Well If I type rails -v (I guess this is the right way?) then I

[Rails] Re: Stupid newbie question

2011-06-03 Thread Sta Canovist
On Jun 3, 8:29 pm, Hassan Schroeder hassan.schroe...@gmail.com wrote: I believe you're doomed  :-) Seriously, this has massive pain written all over it; 1.2.6 is ancient. If I were you, I'd find someone who knows Rails, let her/him log into the test server you previously mentioned and clone

[Rails] Re: Stupid newbie question

2011-06-03 Thread Sta Canovist
On Jun 3, 9:19 pm, Norm Scherer normsche...@earthlink.net wrote: This tells you what rails is installed on your system (at least what is in your path).  The real question is what rails version the application is running with on the target system wherever that is.  You need to run 'rails -v' on

[Rails] Stupid newbie question

2011-06-02 Thread Sta Canovist
Yes, Im new to Ruby. COming from PHP/Java world. I DON'T want to learn ruby, sigh. Anyway I got a project that is done in ruby and it need some modifications sometimes. So until now, dont know how, I managed fixing a few things on that application. Sometimes was about setting a page to show more

[Rails] Re: Stupid newbie question

2011-06-02 Thread Sta Canovist
Ok guys. Thank you all. I have been fighting with this for several days. And only while I was writing the first post I realized that, well, Apache need to know that one is a ror app sigh! SO most of you reccomend passenger. I hade a look at the doc. The I thought it would be better to just go