Search Results

Search found 10455 results on 419 pages for 'ruby on rails 3 1'.

Page 20/419 | < Previous Page | 16 17 18 19 20 21 22 23 24 25 26 27  | Next Page >

  • Rails routing issue

    - by Brob
    Hi I've just started learning rails and been going through some tutorials from learning rails (http://www.buildingwebapps.com/podcasts/79335-putting-the-page-contents-into-the) The tutorials appear to be Rails v2 and I'm on Rails v3 There is a line in the routes file which appears to be causing a problem map.view_page ':name', :controller => 'viewer', :action => 'show' The line works for the front end view i.e. my viewer controller but not for the back end I get the error NoMethodError in Viewer#show I think this has something to do with the view I am using and the line <%= @page.body %> I know it's difficult without the full code but if anyone can help that would be awesome

    Read the article

  • Rails BDD with Cucumber: no such file to load -- cucumber-rails

    - by sev
    I have project on Rails (2.3.5). I add into environment.rb same sting: config.gem "cucumber-rails", run "rake gems:unpack:dependencies". Output of "rake gems": [F] cucumber-rails [F] cucumber = 0.6.2 [F] term-ansicolor = 1.0.4 [F] treetop = 1.4.2 [F] polyglot = 0.3.1 [F] polyglot = 0.2.9 [F] builder = 2.1.2 [F] diff-lcs = 1.1.2 [F] json_pure = 1.2.0 When I run "script/generate cucumber" I get Missing these required gems: cucumber-rails Who can help me to fix this?

    Read the article

  • Get data from html form to ruby in Ruby on Rails

    - by Maestro1024
    Get data from html form to ruby in Ruby on Rails I have some html like this <html> <h1>Text to PDF</h1> <textarea name="comments" cols="40" rows="5"> Enter your Text here... </textarea><br> <input type="submit" value="Submit" /> </form> </body> </html> I want to give the value of the text into the controller for this page/view. How do I do this with rails? I am new to rails, what is the mechanism for this? I don't need to write to the database just want to hand it to the controller. If there is a good tutorial for this sort of thing that would be great, I am not convince I am approaching this correctly.

    Read the article

  • Two threads in a rails initializer file seems to not run them properly

    - by Luccas
    Initially I was using one thread to listen a queue from amazon and works perfectly. aws.rb Thread.new do queue1 = AWS::SQS::Queue.new(SQSADDR['my_queue']) queue1.poll do |msg| ... but now I appended another thread to listen another queue: ... Thread.new do queue2 = AWS::SQS::Queue.new(SQSADDR['my_another_queue']) queue2.poll do |msg| ... and now it seems to not work. Only the last one receives response... I have to join the threads? I can't understand What is going on?

    Read the article

  • How to create view in RoR if skipped during controller generation

    - by swapnesh
    When I run this: rails generate controller hello index it no doubt generates hello controller, but accidentally when I run another command like this: rails generate controller world it creates the world controller successfully, but missed the Route "world/index" like as "hello/index". For this mistake I need to use destroy controller and then generate it once more, is thr some kind of mid way command that I can generate if forgotten something rather than destroying and creating every time. This command rails generate controller contact-us index creates a route as contact_us/index or contact_us after changing routes.rb under config folder. How could I create a more SEO friendly URL in RoR? Like localhost:3000/contact-us? I am working on some very basic rules to follow RoR..like 3 static pages (Home, About us, Contact Us) Just simple html content to understand more, will certainly add more features to it as well. localhost:3000/home localhost:3000/About_us localhost:3000/contact_us I created this via creating home, About_us, contact_us controller command and then changed html in views. Since I am on an initial phase, I read somewhere for static pages we can create this in our public like what we have error pages there in the folder or the approach im using is correct?

    Read the article

  • Ruby on Rails app in root directory?

    - by Chris Leah
    Hey guys, new to rails, but I have found out how to create an app now through the shell but to create an app using rails appname would give me a url of http://url.com/appname/ but I want my app, to be within the route if you understand me, so it's just http://url.com/login/ or /signup or /play so on? So does anyone have any ideas how to do this, or why you can't or I shouldn't? Anything really, thanks guys!

    Read the article

  • Textmate Ruby on Rails Highlighting

    - by yuval
    Hi, I have textmate 1.5.7 running on my leopard machine. When programming in rails, for some reason some key words do not get highlighted. For example: validates_presence_of, has_many, remote_form_for (form_for gets highlighted) etc... I tried switching themes and it did not help. I also tried upgrading to the most recent rails bundle from http://railsbundle.com/ but no cigar. Could someone please help? Thank you very much, Yuval

    Read the article

  • Local install of sqlite3-ruby

    - by Skully
    On my current system i dont have root-access and i want to install sqlite3-ruby. I can compile it and i know how to set custom install-folder, but how does my ruby-installation can recognize/find that installed gem for usage? I tried prefix of my custom RUBYLIB-Folder but that didnt work either. Any suggestions? Thanks skully

    Read the article

  • How to install curl on windows for ruby on rails

    - by Gautam
    Hi, I am new to ruby on rails. Could you please help me to install curl. I have windows 7 and ruby 1.8.7 I need to install Paul Dix's FeedZirra. I need curl for that. Also could you help me with gem install curb. Even curb seems to need Curl Looking forward for your help Thank You Gautam

    Read the article

  • when executing Powershell Script from Ruby "Can't convert true into String" error

    - by Ozie Harb
    I am trying to execute a powershell script from Ruby, I have entered the below command: scriptPath = system('powershell \"C:\\Scripts\\DB_Setup.ps1\"') The ruby Script is handling exceptions when an error is raised to stop the script as below command: rescue => ex message = "\nscript on server '#{`hostname`.strip()}' terminated unexpectedly:\n\nMessage: '#{ex.message}" raise ex Output Error: script on server 'TestDB1' terminated unexpectedly: Message: 'can't convert true into String' Thanks

    Read the article

  • Ruby generic filesystem libraries

    - by webdestroya
    I am looking for a "Virtual File System" type library for ruby. I want to be able to have a completely generic file system that I can easily switch between using Local files and using S3 or using FTP or something like that. (Identical to VFS for Java) Has anybody used any type of generic file system for ruby (I just need it to support local files and Amazon S3) Any pointers would be much appreciated.

    Read the article

  • Who's using Ruby on Rails in production?

    - by Jekke
    I've been kicking around Ruby and the rails framework and have been considering recommending to a client-of-a-client that they use it to rebuild their site, which is currently built in very bad ASP classic that will have to be rewritten from the ground up regardless of what technology is used. One thing I'm missing from my pitch is a list of major sites using Ruby-on-Rails. Are there any yet?

    Read the article

  • Parametrized get request in Ruby?

    - by Horace Loeb
    How do I make an HTTP GET request with parameters in Ruby? It's easy to do when you're POSTing: require 'net/http' require 'uri' HTTP.post_form URI.parse('http://www.example.com/search.cgi'), { "q" => "ruby", "max" => "50" } But I see now way of passing GET parameters as a hash using net/http.

    Read the article

  • Convert SQL query to Ruby help

    - by Verloren
    Hey all, I need to query my database table to find which employee has the most support tickets related to them. I can do this just fine using this MySQL query: SELECT employee_id, COUNT(id) AS number_of_tickets FROM tickets GROUP BY employee_id ORDER BY number_of_tickets DESC LIMIT 1; How would write this in Ruby-on-Rails? Thanks very much for your assistance. I use Ruby version 1.8.6, Rails version 2.2.2 and MySQL Server version 5.0.

    Read the article

  • floating point precision in ruby on rails model validations

    - by Chris Allison
    Hello I am trying to validate a dollar amount using a regex: ^[0-9]+\.[0-9]{2}$ This works fine, but whenever a user submits the form and the dollar amount ends in 0(zero), ruby(or rails?) chops the 0 off. So 500.00 turns into 500.0 thus failing the regex validation. Is there any way to make ruby/rails keep the format entered by the user, regardless of trailing zeros?

    Read the article

  • Ruby Rails _without_ ActiveRecord

    - by devlearn
    Hello, I'm looking for any pointers on how to write a rails web app without ActiveRecord. A doc or an example of a (not too complex) web app using storage backends other than a relational database would be greatly appreciated. It's not clear on what should be implemented in the model classes in order to make the rails app work without the ActiveRecord layer. Thanks,

    Read the article

  • Ruby On Rails and UTF-8

    - by Semyon Perepelitsa
    I have an Rails application with SayController, hello action and view template say/hello.html.erb. When I add some cyrillic character like "?", I get an error: ArgumentError in SayController#hello invalid byte sequence in UTF-8 Headers: {"Cache-Control"=>"no-cache", "X-Runtime"=>"11", "Content-Type"=>"text/html; charset=utf-8"} I use Windows 7 x64, Ruby 1.9.1p378, Rails 2.3.5, WEBrick server.

    Read the article

  • like-vim emacs ruby indentation

    - by edbond
    ruby-mode from svn, looks equal to 1.1 version here is emacs indentation of hash User.all({ :joins => :account, :conditions => {:delete_at => nil} }) here is the same in vim User.all({ :joins => :account, :conditions => {:delete_at => nil} }) How to make emacs indent like vim in ruby-mode?

    Read the article

  • Rails/Node.js interaction

    - by lpvn
    I and my co-worker are developing a web application with rails and node.js and we can't reach a consensus regarding a particular architectural decision. Our setup is basically a rails server working with node.js and redis, when a client makes a http request to our rails API in some cases our rails application posts the response to a redis database and then node.js transmits the response via websocket. Our disagreement occurs in the following point: my co-worker thinks that using node.js to send data to clients is somewhat business logic and should be inside the model, so in the first code he wrote he used commands of broadcast in callbacks and other places of the model, he's convinced that the models are the best place for the interaction between rails and node. I on the other hand think that using node.js belongs to the runtime realm, my take is that the broadcast commands and other node.js interactions should be in the controller and should only be used in a model if passed through a well defined interface, just like the situation when a model needs to access the current user of a session. At this point we're tired of arguing over this same thing and our discussion consists in us repeating to ourselves our same opinions over and over. Could anyone, preferably with experience in the same setup, give us an unambiguous response saying which solution is more adequate and why it is?

    Read the article

  • Backbone.js, Rails and code duplication

    - by Matteo Pagliazzi
    I'm building a web app and I need a JS framework like Backbone.js to work with my backend rovided by Rails that mostly return JSON objects after DB queries. Searching on the web I've discovered Backbone which seems to be complete, quite populare and actively developed but I've noticed that a lot of things done by Backbone are simply a duplicte of the works done by Rails: for example validation and models. My idea of "perfect" (for my actual needs) JS mvc (it can't be called mvc but i don't have any other names) is something really simple that has a function for each action in my Rails controller that are triggered by a specific event (user/hash changes, click on a button...) and send requests to the server that respond with a JSON object then I'll load a template or execute some JS code. Do you have any concern/suggestion about my idea? Do you know some "micro" js framework like what i have described? If you have worked with backone.js + rails what can you suggest me?

    Read the article

< Previous Page | 16 17 18 19 20 21 22 23 24 25 26 27  | Next Page >