[Rails] Active Record Associations and papermill
I have a model Chapter I figured out how to add assets to chapter through papermill plugin. Now the question: how can i add additional description to each asset? It can look like: chapter has_many items item belongs_to chapter item has_one papermill_asset papermill_asset belongs_to item But i don't know how to build models and view for described scheme. How can I add new line in intem table then papermill creats new one in papermill_assets? Or may be you know the true way to solve this problem? Any help? Thx. -- 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 rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Re: Rails 3 Error:uninitialized constant ActiveResource::Base
Thx! -- 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 rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Rails 3 Error:uninitialized constant ActiveResource::Base
I'v just install rails3 for try it out. I was following getting started guide: rm public/index.html, change routes... and then i try to open page i'v got an error. OS: ubunto 10.04 Rails info: dp...@dpush-desktop:~/rails_proj/blog/public$ ruby -v ruby 1.8.7 (2010-01-10 patchlevel 249) [x86_64-linux] dp...@dpush-desktop:~/rails_proj/blog/public$ rails -v Rails 3.0.0.beta3 dp...@dpush-desktop:~/rails_proj/blog/public$ gem list *** LOCAL GEMS *** abstract (1.0.0) actionmailer (3.0.0.beta3) actionpack (3.0.0.beta3) activemodel (3.0.0.beta3) activerecord (3.0.0.beta3) activeresource (3.0.0.beta3) activesupport (3.0.0.beta3, 2.3.6) arel (0.3.3) builder (2.1.2) bundler (0.9.25) erubis (2.6.5) i18n (0.3.7) mail (2.2.1) memcache-client (1.8.3) mime-types (1.16) polyglot (0.3.1) rack (1.1.0) rack-mount (0.6.3) rack-test (0.5.3) rails (3.0.0.beta3) railties (3.0.0.beta3) rake (0.8.7) text-format (1.0.0) text-hyphen (1.0.0) thor (0.13.6) treetop (1.4.5) tzinfo (0.3.20) ERROR NameError: uninitialized constant ActiveResource::Base /usr/lib/ruby/gems/1.8/gems/activeresource-3.0.0.beta3/lib/ active_resource/railties/log_subscriber.rb:11:in `logger' /usr/lib/ruby/gems/1.8/gems/actionpack-3.0.0.beta3/lib/action_view/ template.rb:107:in `to_proc' /usr/lib/ruby/gems/1.8/gems/railties-3.0.0.beta3/lib/rails/ log_subscriber.rb:75:in `map' /usr/lib/ruby/gems/1.8/gems/railties-3.0.0.beta3/lib/rails/ log_subscriber.rb:75:in `flush_all!' /usr/lib/ruby/gems/1.8/gems/railties-3.0.0.beta3/lib/rails/rack/ logger.rb:29:in `after_dispatch' /usr/lib/ruby/gems/1.8/gems/railties-3.0.0.beta3/lib/rails/rack/ logger.rb:15:in `call' /usr/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/runtime.rb:17:in `call' /usr/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/lock.rb:11:in `call' /usr/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/lock.rb:11:in `synchronize' /usr/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/lock.rb:11:in `call' /usr/lib/ruby/gems/1.8/gems/actionpack-3.0.0.beta3/lib/ action_dispatch/middleware/static.rb:30:in `call' /usr/lib/ruby/gems/1.8/gems/railties-3.0.0.beta3/lib/rails/ application.rb:132:in `call' /usr/lib/ruby/gems/1.8/gems/railties-3.0.0.beta3/lib/rails/ application.rb:81:in `send' /usr/lib/ruby/gems/1.8/gems/railties-3.0.0.beta3/lib/rails/ application.rb:81:in `method_missing' /usr/lib/ruby/gems/1.8/gems/railties-3.0.0.beta3/lib/rails/rack/ log_tailer.rb:15:in `call' /usr/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/content_length.rb: 13:in `call' /usr/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/handler/webrick.rb: 48:in `service' /usr/lib/ruby/1.8/webrick/httpserver.rb:104:in `service' /usr/lib/ruby/1.8/webrick/httpserver.rb:65:in `run' /usr/lib/ruby/1.8/webrick/server.rb:173:in `start_thread' /usr/lib/ruby/1.8/webrick/server.rb:162:in `start' /usr/lib/ruby/1.8/webrick/server.rb:162:in `start_thread' /usr/lib/ruby/1.8/webrick/server.rb:95:in `start' /usr/lib/ruby/1.8/webrick/server.rb:92:in `each' /usr/lib/ruby/1.8/webrick/server.rb:92:in `start' /usr/lib/ruby/1.8/webrick/server.rb:23:in `start' /usr/lib/ruby/1.8/webrick/server.rb:82:in `start' /usr/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/handler/webrick.rb: 14:in `run' /usr/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/server.rb:155:in `start' /usr/lib/ruby/gems/1.8/gems/railties-3.0.0.beta3/lib/rails/commands/ server.rb:62:in `start' /usr/lib/ruby/gems/1.8/gems/railties-3.0.0.beta3/lib/rails/ commands.rb:42 script/rails:9:in `require' script/rails:9 any help? -- 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 rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Rails 3 Error:uninitialized constant ActiveResource::Base
I'v just install rails3 for try it out. I was following getting started guide: rm public/index.html, change routes... and then i try to open page i'v got an error. OS: ubunto 10.04 Rails info: dp...@dpush-desktop:~/rails_proj/blog/public$ ruby -v ruby 1.8.7 (2010-01-10 patchlevel 249) [x86_64-linux] dp...@dpush-desktop:~/rails_proj/blog/public$ rails -v Rails 3.0.0.beta3 dp...@dpush-desktop:~/rails_proj/blog/public$ gem list *** LOCAL GEMS *** abstract (1.0.0) actionmailer (3.0.0.beta3) actionpack (3.0.0.beta3) activemodel (3.0.0.beta3) activerecord (3.0.0.beta3) activeresource (3.0.0.beta3) activesupport (3.0.0.beta3, 2.3.6) arel (0.3.3) builder (2.1.2) bundler (0.9.25) erubis (2.6.5) i18n (0.3.7) mail (2.2.1) memcache-client (1.8.3) mime-types (1.16) polyglot (0.3.1) rack (1.1.0) rack-mount (0.6.3) rack-test (0.5.3) rails (3.0.0.beta3) railties (3.0.0.beta3) rake (0.8.7) text-format (1.0.0) text-hyphen (1.0.0) thor (0.13.6) treetop (1.4.5) tzinfo (0.3.20) ERROR NameError: uninitialized constant ActiveResource::Base /usr/lib/ruby/gems/1.8/gems/activeresource-3.0.0.beta3/lib/ active_resource/railties/log_subscriber.rb:11:in `logger' /usr/lib/ruby/gems/1.8/gems/actionpack-3.0.0.beta3/lib/action_view/ template.rb:107:in `to_proc' /usr/lib/ruby/gems/1.8/gems/railties-3.0.0.beta3/lib/rails/ log_subscriber.rb:75:in `map' /usr/lib/ruby/gems/1.8/gems/railties-3.0.0.beta3/lib/rails/ log_subscriber.rb:75:in `flush_all!' /usr/lib/ruby/gems/1.8/gems/railties-3.0.0.beta3/lib/rails/rack/ logger.rb:29:in `after_dispatch' /usr/lib/ruby/gems/1.8/gems/railties-3.0.0.beta3/lib/rails/rack/ logger.rb:15:in `call' /usr/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/runtime.rb:17:in `call' /usr/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/lock.rb:11:in `call' /usr/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/lock.rb:11:in `synchronize' /usr/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/lock.rb:11:in `call' /usr/lib/ruby/gems/1.8/gems/actionpack-3.0.0.beta3/lib/ action_dispatch/middleware/static.rb:30:in `call' /usr/lib/ruby/gems/1.8/gems/railties-3.0.0.beta3/lib/rails/ application.rb:132:in `call' /usr/lib/ruby/gems/1.8/gems/railties-3.0.0.beta3/lib/rails/ application.rb:81:in `send' /usr/lib/ruby/gems/1.8/gems/railties-3.0.0.beta3/lib/rails/ application.rb:81:in `method_missing' /usr/lib/ruby/gems/1.8/gems/railties-3.0.0.beta3/lib/rails/rack/ log_tailer.rb:15:in `call' /usr/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/content_length.rb: 13:in `call' /usr/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/handler/webrick.rb: 48:in `service' /usr/lib/ruby/1.8/webrick/httpserver.rb:104:in `service' /usr/lib/ruby/1.8/webrick/httpserver.rb:65:in `run' /usr/lib/ruby/1.8/webrick/server.rb:173:in `start_thread' /usr/lib/ruby/1.8/webrick/server.rb:162:in `start' /usr/lib/ruby/1.8/webrick/server.rb:162:in `start_thread' /usr/lib/ruby/1.8/webrick/server.rb:95:in `start' /usr/lib/ruby/1.8/webrick/server.rb:92:in `each' /usr/lib/ruby/1.8/webrick/server.rb:92:in `start' /usr/lib/ruby/1.8/webrick/server.rb:23:in `start' /usr/lib/ruby/1.8/webrick/server.rb:82:in `start' /usr/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/handler/webrick.rb: 14:in `run' /usr/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/server.rb:155:in `start' /usr/lib/ruby/gems/1.8/gems/railties-3.0.0.beta3/lib/rails/commands/ server.rb:62:in `start' /usr/lib/ruby/gems/1.8/gems/railties-3.0.0.beta3/lib/rails/ commands.rb:42 script/rails:9:in `require' script/rails:9 any help? -- 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 rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Re: Security issue in app
%=h @text_from_user % The point is 'h' helper. http://guides.rubyonrails.org/getting_started.html - will be very useful to read. Good luck. On Apr 5, 2:11 pm, Tushar Gandhi li...@ruby-forum.com wrote: Hi, I am facing a following problem:- I have app in which user can edit his/her personal information and we are showing it on browser. Some of users has added scriptalert('Hack');/script javascript in name textbox. Due to this whenever I am showing name on browser it is executing the script and giving javascript alert. Can anyone tell me how to fix this? Is there any plugin avaliable? Thanks, Tushar -- Posted viahttp://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 this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Re: providing feedback to users
It can by manage if you you using AJAX, and it's many ways to do it, there one: just show some div id='waiter' style='dislpay:none'pleas wait/div on 'ajax start' event and hide this one on 'ajax end' event. If you choose jqure (jquery.com) it would look like: $(#loading).ajaxStart(function(){ $(this).show(); }); (#loading).ajaxStop(function(){ $(this).hide(); }); http://api.jquery.com/ajaxStart/ http://api.jquery.com/ajaxStop/ On Apr 2, 1:25 am, mstoth mich...@virtualpianist.com wrote: I have an application which does some time-consuming work after a form is submitted. I'd like to have a little message saying please wait but I'm not sure how to implement that. I'm thinking somehow you have to send a page to the browser from the method that is being called by the form. Sounds like a basic thing but I'm kind of new to RoR. Any ideas? -Michael -- 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 rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Re: Two controllers with create using the same model
in your link I can see: beiratkozas_controller.rb subscriptions_controller.rb but where is students_controller.rb (StudentsController) ? Dose ruby asking you the same question?:) On Apr 2, 4:04 pm, WSzP c...@ctdd.ro wrote: Any ideas? I still can't find out why this does not work, or how to solve. Or you guys prefer pasting code into the email instead ofhttp://pastie.org/899454? Thanks a lot. And Happy Easter! -- 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 rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Re: Two controllers with create using the same model
In addition, it happens because you using % form_for(@student) do | f| % helper if you look in HTML code (this helper appears to) you can find that request will be send to student controller... On Apr 2, 4:15 pm, DmitryPush dmitryp...@gmail.com wrote: in your link I can see: beiratkozas_controller.rb subscriptions_controller.rb but where is students_controller.rb (StudentsController) ? Dose ruby asking you the same question?:) On Apr 2, 4:04 pm, WSzP c...@ctdd.ro wrote: Any ideas? I still can't find out why this does not work, or how to solve. Or you guys prefer pasting code into the email instead ofhttp://pastie.org/899454? Thanks a lot. And Happy Easter! -- 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 rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Re: Two controllers with create using the same model
so now we can see exactly what rails told you - it is now create method in student controller. :) and why you view requesting student controller i already told you. :) On Apr 2, 4:39 pm, WSzP c...@ctdd.ro wrote: Hello, Thanks a lot, and here is my students_controller.rb:http://pastie.org/900218 So I had one, but forgot to paste it to pastie. Peter -- 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 rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Re: any body can help me ?? why is this happen??
(0.29*100).to_s.to_i will return what you expect. On Mar 31, 10:27 am, Jimish Jobanputra li...@ruby-forum.com wrote: Scary! irb(main):019:0 (0.57 * 100).to_i = 56 irb(main):020:0 (0.58 * 100).to_i = 57 This is totally out of my understanding Will look into core... seems like some bug... -- Posted viahttp://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 this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Re: regular expression
This is very good tutorial (don't be upset its for perl, in ruby regexp works pretty the same) http://sunsite.ualberta.ca/Documentation/Misc/perl-5.6.1/pod/perlretut.html a. - [] - causing group of symbols, for eg /[bcr]at/ matches 'bat, 'cat', or 'rat' b. 1 - it's a first math ($1 in perl) c. look ahead : by default regexp is greed, it means /.*/ will math as much as possible but it some time you don't need it then you can use /.*?/ instead. what's why 'minimal match' sort of look ahead to not match more then you need to. I'm not sure I explain my self clear enough :)) you can find all answers in tutorial that i post here. d. because it's ruby syntax On Mar 31, 2:56 pm, tonypm tonypmar...@hotmail.com wrote: Interesting to see two regexperts slogging it out :) Seriously though, I have to confess I have a real block when it comes to regexp. There seem to be so many variants of ways of doing things. This example is the sort of thing I have done in the past, but never so elegantly. Trouble is I am not entirely sure what is going on in this syntax. I wonder if one of the two bright guys here could help with a little explanation of for example: a. the square brackets causing the match? b. the 1 c. look ahead? d. why does the 1 return block without the $ I would really like to get my head around this stuff. If you know of a good tutorial/guide that would be helpful too. The problem I find is that so many of the guides go over the same basic stuff, I seem to read loads of things and never get to the real meaty bits, or the explanation of the meaty bits then goes over my head. I don't mind admitting to being dumb! Thanks Tonypm -- 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 rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Re: regular expression
$ irb module$block.item[/\$([^.]*)\./,1] = block -- 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 rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Re: regular expression
A came to ruby from perl and as I know my solution faster there. Ofcourse in this case it doesn't matter. But understating how works your and mine solutions may be useful... I've seen your massage and post mine only for educational reasons. Plus mine look's nicer, I just kidding:) PS I don't know why it can be that in 1.8.7 look behind solution can be faster, you do? On Mar 24, 12:00 pm, Andy Jeffries andyjeffr...@gmail.com wrote: Dmitry posted pretty much the same solution as I did, but a slightly different regular expression. On Ruby 1.8.7 (your Ruby version may vary) my regex is *slightly* faster. On Ruby 1.9.1 his is *slightly* faster. The difference is 0.3s over 10,000,000 iterations, so either way it's pretty instantaneous and won't be the bottleneck in your app :-) Just thought I'd post this as Dmitry posted his solution that looked identical to mine at a cursory glance... Dmitry what was your reasoning behind posting the same solution with a slightly different regex without an explanation as to why? Did you not see my message? Just curious... Cheers, Andy -- Andy Jeffrieshttp://andyjeffries.co.uk/ #rubyonrails #mysql #jquery Registered address: 64 Sish Lane, Stevenage, Herts, SG1 3LS Company number: 5452840 On 24 March 2010 07:15, DmitryPush dmitryp...@gmail.com wrote: $ irb module$block.item[/\$([^.]*)\./,1] = block -- 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 rubyonrails-talk+unsubscr...@googlegroups.comrubyonrails-talk%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en. -- 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 rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Re: Problem Installing Passenger
try to install 'ruby-devel', in ubuntu it 'gem install ruby-devel' I guess Is it helps? On Mar 24, 3:17 pm, Christophe Decaux christophe.dec...@gmail.com wrote: Thanks Leonardo, I installed everything with gem Anyone else ? Le 24 mars 2010 à 13:13, Leonardo Mateo a écrit : On Wed, Mar 24, 2010 at 9:08 AM, Christophe Decaux christophe.dec...@gmail.com wrote: Hi there, I'm trying to install passenger on a hosted server which has Ubuntu 9.04 Ruby 1.8.6 Rails 2.3.5 Apache 2 I had some trouble with gem install passenger, but went through after installing build-essential which were not on the machine. First when I launched passenger-install-apache2-module, it complained about Apache not in the correct mpm mode, so I installed mpm-prefork Now when I relaunch passenger-install-apache2-module, I get this: Compiling and installing Apache 2 module... cd /srv/d_prod/home/christophe/gems/gems/passenger-2.2.11 /usr/bin/ruby1.8 -S /usr/bin/rake clean apache2 # /usr/bin/ruby1.8 -S /usr/bin/rake clean apache2 (in /srv/d_prod/home/christophe/gems/gems/passenger-2.2.11) rake aborted! undefined method `rakefile' for #Rake::Application:0xb7c6719c /srv/d_prod/home/christophe/gems/gems/passenger-2.2.11/Rakefile:630:in `new' (See full trace by running task with --trace) I also reinstalled rake Any thoughts, anyone ? How did you install rake? with through gem or through package manager? Try to avoid gems installation via the package manager, my advice, based on the experience on Debian(-like) systems with this things is you have to install only rubygems from the package manager and then, everything else with the gem command. Hope it helps. -- Leonardo Mateo. There's no place like ~ -- 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 rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group athttp://groups.google.com/group/rubyonrails-talk?hl=en. -- 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 rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Re: Restful create URL
As you now URL its a GET method, but according RESTful rules create it's a POST method. Rails defines seven controller methods for RESTful resources by convention. They are: Action HTTP Method Purpose - indexGET Displays a collection of resources show GET Displays a single resource new GET Displays a form for creating a new resource create POST Creates a new resource (new submits to this) edit GET Displays a form for editing an existing resource update PUT Updates an existing resource (edit submits to this) destroy DELETE Destroys a single resource You can find out it your self by: $ rake routes If you still want use create action by GET method you can reach it by routes.rb file. Following links help you figure out it: http://api.rubyonrails.org/classes/ActionController/Routing.html http://api.rubyonrails.org/classes/ActionController/AbstractRequest.html -- 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 rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Re: Rail Quickstart Guide: Always receiving template missing errors.
If you read carefully http://guides.rubyonrails.org/getting_started.html you can find that in your routes.rb file have to be following lines map.connect ':controller/:action/:id' map.connect ':controller/:action/:id.:format' I also new in RoR and I don't know why you wrote map.connect 'home/ index', :controller = 'home', :action = 'index' in your routes.rb. and what it should be mean. We both need to read more about routes in RoR. On Mar 20, 2:34 am, Stone vtgbe...@gmail.com wrote: Thanks for your time. I'm almost sure there is no typo on my part. I'm actually starting to think there's something wrong with the environment as I have created small ror apps before without any issues and am somewhat experiences w/ rails. Having gone through the rails quickstart guide again, I have the same issue w/ home controller. home_controller.rb -- class HomeController ApplicationController def index end end routes.rb - ActionController::Routing::Routes.draw do |map| # The priority is based upon order of creation: first created - highest priority. map.connect 'home/index', :controller = 'home', :action = 'index' # Sample of regular route: # map.connect 'products/:id', :controller = 'catalog', :action = 'view' # Keep in mind you can assign values other than :controller and :action # Sample of named route: # map.purchase 'products/:id/purchase', :controller = 'catalog', :action = 'purchase' # This route can be invoked with purchase_url(:id = product.id) # Sample resource route (maps HTTP verbs to controller actions automatically): # map.resources :products # Sample resource route with options: # map.resources :products, :member = { :short = :get, :toggle = :post }, :collection = { :sold = :get } # Sample resource route with sub-resources: # map.resources :products, :has_many = [ :comments, :sales ], :has_one = :seller # Sample resource route with more complex sub-resources # map.resources :products do |products| # products.resources :comments # products.resources :sales, :collection = { :recent = :get } # end # Sample resource route within a namespace: # map.namespace :admin do |admin| # # Directs /admin/products/* to Admin::ProductsController (app/ controllers/admin/products_controller.rb) # admin.resources :products # end # You can have the root of your site routed with map.root -- just remember to delete public/index.html. # map.root :controller = welcome # See how all your routes lay out with rake routes # Install the default routes as the lowest priority. # Note: These default routes make all actions in every controller accessible via GET requests. You should # consider removing or commenting them out if you're using named routes and resources. map.root :controller = home end index.html.erb - h1Home#index/h1 pFind me in app/views/home/index.html.erb/p Again, I am following the rails quickstart guide for 2.3 verbatim and still receiving this error: Processing HomeController#index (for 127.0.0.1 at 2010-03-19 15:42:14) [GET] ActionView::MissingTemplate (Missing template home/index.erb in view path app/views): Rendering rescues/layout (internal_server_error) Any help greatly appreciated Thanks, Stone -- 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 rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Re: Rail Quickstart Guide: Always receiving template missing errors.
Are you sure you don't have a typo, and name of your template looks exactly like that app/views/posts/index.html.erb ? if it's not could you provide here your posts controller, routs and index view On Mar 19, 3:14 am, Stone vtgbe...@gmail.com wrote: Hello, Upon going through the rails quickstart guide:http://guides.rubyonrails.org/getting_started.html; also this guide here:http://fuelyourcoding.com/creating-your-first-ruby-on-rails-applicati... - I always get Missing Template errors. Specifically: Template is missing Missing template posts/index.erb in view path app/views Currently the file index.html.erb lives in app/views/posts/ - why is the error message looking for a .erb file when there is a .html.erb file in the folder that was created by a scaffold command? Renaming the file to .erb does not solve the problem. Here's my setup info from localhost:3000 Ruby version 1.8.7 (universal-darwin10.0) RubyGems version 1.3.6 Rack version 1.0 Rails version 2.3.5 Active Record version 2.3.5 Active Resource version 2.3.5 Action Mailer version 2.3.5 Active Support version 2.3.5 Application root /Users/vtgbeats/[ Projects ]/[ Rails Apps ]/slambook Environment development Database adapter sqlite3 Database schema version 20100318235949 The routes.rb file is in default state. I've successfully created small RORs apps before and now I can't even render a view, please help. Thanks everyone, Stone -- 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 rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Re: Facebook style photo uploader
also you can take a look on Uploadify it's not like in Facebook but it's pretty simple to install and use. demo: http://www.uploadify.com/demo/ Rails and uplodify: http://casperfabricius.com/site/2009/03/26/uploading-multiple-files-with-progress-indicator-using-jquery-flash-and-rails/ http://drawohara.com/post/182116634/rails-uploadify-the-easy-way On Mar 19, 11:12 am, Marcin Seroczynski sere...@gmail.com wrote: Or You could simply take a look at ready to use projects from github like:http://github.com/bbenezech/papermillhttp://github.com/jbasdf/uploader Which need only some stylings in CSS to have same lookfeel like Facebook. -Martin On 19 Mar, 08:28, Kevin Elliott ke...@phunc.com wrote: Darren, You should take a look at swfupload. It is a combination of javascript and Flash so that you can upload in the background, report on the progress, etc. -Kevin On Thu, Mar 18, 2010 at 1:00 PM, Ruby on Rails: Talk dazzaroo...@gmail.comwrote: Hi Does anyone know of a plugin or something similar which would add the Facebook style photo uploader (or something which will provide the same function)? Thanks in advance. Darren -- 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 rubyonrails-talk+unsubscr...@googlegroups.comrubyonrails-talk%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en. -- Kevin Elliott ke...@phunc.com |http://kevinelliott.net|http://twitter.com/kevinelliott -- 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 rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Re: Send Java script variable to a controller
Here is non ajax method(but ajax pretty the same): var f = document.createElement('form'); f.style.display = 'none'; this.parentNode.appendChild(f); f.method = 'POST'; #or get f.action = this.href; var m = document.createElement('input'); m.setAttribute('type', 'hidden'); m.setAttribute('name', '_method'); //m.setAttribute('value', 'delete'); #or put it depends of your needs f.appendChild(m); //Now we can send your variables: var s = document.createElement('input'); s.setAttribute('type', 'hidden'); s.setAttribute('name', 'my_var'); s.setAttribute('value', 'my_var_value'); f.appendChild(s); f.submit(); On Mar 18, 10:48 pm, Mohammed Alenazi vb4...@gmail.com wrote: I am trying to build an application that has google maps. Inside the script there are two java script variables. I want to send those two variables using a java function. What is the best why to do that. Could someone give me a simple example on that. -- 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 rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Re: REST, Internet Explorer and the banned DELETE method
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); f.method = 'POST'; f.action = this.href;var m = document.createElement('input'); m.setAttribute('type', 'hidden'); m.setAttribute('name', '_method'); m.setAttribute('value', 'delete'); f.appendChild(m);var s = document.createElement('input'); s.setAttribute('type', 'hidden'); s.setAttribute('name', 'authenticity_token'); s.setAttribute('value', 'LgNwcxaXQ3+NT95f1SJYo1ZOUfXMFtQimzSzDmjJM3g='); f.appendChild(s);f.submit(); };return false; href=/photos/ 51Destroy/a as you can see its still post, but it has hidden input that tells your controller about delete. -- 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 rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Re: REST, Internet Explorer and the banned DELETE method
*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 rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Re: REST, Internet Explorer and the banned DELETE method
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= name=authenticity_token /div .. p input type=submit value=Update name=commit id=photo_submit /p /form -- 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 rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] RESTful photo album
Hi, all! I'm new in Rails. I've read Agile web development and now I want made my very first rails application - photo album. But I don't know how to design it RESTful. For example I have 3 chapters and 100 photos on each one and i want list only 10 photos on page. How should look request for such resource? Maybe: site.my/chapter/2/4 (controller:chapter, action: chapter_id=2, page=4) If its good then how to send to controller 2 parameters ? Or maybe you can explain me how it can be done right way? And now I also want know in general how to process request like site.my/say/hello/to/homer I know if it just site.my/say/hello - then 'say' - it's controller and' hello' - it's action, but what when 'to' and 'homer'? How exactly tell my rails application whet I want say hello to Homer? Thanks in advance! PS sorry for so many stupid questions but I don't have any one next to me who about Rails(( -- 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 rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Re: RESTful photo album
Thx! Sounds good. I'll try it and later I'll post hear where it drive me to:) -- 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 rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.