Search Results

Search found 253632 results on 10146 pages for 'rails stack'.

Page 7/10146 | < Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >

  • Render public html's for dynamic banners in Rails ?

    - by benoror
    Hi, I would like to render specific HTML snippets for displaying banners, because each banner has a different nature (some images, some flash, etc). Every banner file is under app/public/banners/. I tried many ways, like: render :file => "/banners/somebanner.html" But it can't locate the file, because rails looks under app/views. Any Ideas ? Thanks! Missing template banners/somebanner.html in view path app/views

    Read the article

  • translate database fields with rails

    - by fursie
    hi I know about the built-in I18n in Rails, but how can I select a database field per locale? My model structure is something like this: title #default (englisch) title_de #(german) title_it #(italian) In my template I want to be able to write only <%= @model.title %> and should get the value in the right language. Is there a plugin or a solution to use different fields per different locale settings with a structure like mine?

    Read the article

  • Ruby on Rails function grapher

    - by Hock
    Hi, I'm looking for a function grapher that I can use in a small Rails application I'm working on for my university. Is there anything out there? If it needs the values (points) is not a problem but it would be better if it just parsed the equation. The functions will be 100% in ruby format (for example Math.exp(3*x))... Thanks a lot! Nicolás Hock

    Read the article

  • Rails 3 Processing by */*

    - by Maestro
    I have noticed that in Rails 3.2.2, all actions are being processed with */* format. So the question is: what means */* ? And why it is called by default (every time) ? Because there are two processings for one action: Started GET "/" for 127.0.0.1 at 2012-07-07 22:50:22 +0200 Processing by MainController#index as HTML Started GET "/" for 127.0.0.1 at 2012-07-07 22:50:22 +0200 Processing by MainController#index as */* I have tried to set: respond_to :html def index @posts = Post.all respond_with(@posts) end But the same problem still exists.

    Read the article

  • Rails nested URL question

    - by Jacobo Tibaquira
    Hi Im having issues with RESTful URLs in Rails. I have site.com/services url, and I want to have subpages under that category, thats it: site.com/services/arquitecture, site.com/services/plumbing, etc. The pages that im serving under that category are "static" .rhtml files and I would want them to be on the same controller. Is there a way of doing this? I've tried nested resources but I find it hard to fully understand. Thanks

    Read the article

  • Rails: Easiest way to provide file downloads?

    - by Schroedinger
    G'day guys, currently have almost finished writing a rails application that allows a CSV download of the database. This is generated when the index is first viewed. Is there an easy way to insert a link to a helper that returns a CSV document? That is to say is it easy to insert links to helpers? This would make a lot of problems I've been having much easier

    Read the article

  • Rails time zones

    - by Bob
    I'm calling an external web service API that returns a timezone as listed in the Olson timezones database (e.g. "America/New_York"). However some of the values the API returned are "US/Pacific", "US/Eastern" and apparently don't match any of the Olson timezones in Rails 2.3.2. Can anyone shed some light on this? Thanks in advance for your help.

    Read the article

  • Rails Application Hosting

    - by deb
    Where do you host your rails applications? I've tried Heroku (shared) and Slicehost (dedicated). I thought I would ask you, the knowledgeable guys here at stack-overflow, for hosting recommendations. Thanks in advance -- Deb

    Read the article

  • Using build with a has_one association in rails.

    - by espinet
    This is a really noob question but im having trouble finding the answer, is there a way in rails to have 0 or 1 association? For example, I create a user with no objects, than later on create an object for that user. I tried using build with a 'has_one' association but that blew up... The only way I see this working is using 'has_many'. The user is suppose to only have at most one of these objects, is there any way to do this?

    Read the article

  • Rails 3 Abstract Class vs Inherited Class

    - by R. Yanchuleff
    In my rails 3 model, I have two classes: Product, Service. I want both to be of type InventoryItem because I have another model called Store and Store has_many :InventoryItems This is what I'm trying to get to, but I'm not sure how to model this in my InventoryItem model and my Product and Service models. Should InventoryItem just be a parent class that Product and Service inherit from, or should InventoryItem be modeled as a class abstract of which Product and Service extend from. Thanks in advance for the advice!

    Read the article

  • Rails Plugin Installation Problem

    - by Steve
    When I tried to install the openid plugin, I do not get any confirmation msg about the installation.Even I specify some random .git plugin name, It does not give out any error. Can someone please tell me what about to do to rectify the problem? I used the following syntax ruby script/plugin install git://github.com/rails/open_id_authentication.git

    Read the article

  • train wreck. Rails requires RubyGems >= 1.3.2

    - by JZ
    I recently upgraded ruby to ruby 1.8.7 (2009-06-12 patchlevel 174) [i686-darwin10] and I think I broke rails. When I attempt to load rails. I get an odd message. Please help! $ ruby script/server Rails requires RubyGems = 1.3.2. Please install RubyGems and try again: http://rubygems.rubyforge.org $ rails -v Rails 3.0.0.beta $ gem -v 1.3.6 $ which gem /usr/bin/gem $ whereis gem /usr/bin/gem $ which rails /usr/bin/rails $ whereis rails /usr/bin/rails $ /usr/bin/gem -v 1.3.6 $ /usr/bin/rails -v Rails 3.0.0.beta $ ruby script/console Rails requires RubyGems >= 1.3.2. Please install RubyGems and try again: http://rubygems.rubyforge.org $ gem list rails *** LOCAL GEMS *** rails (3.0.0.beta, 2.3.5, 2.2.2, 1.2.6) $ gem list *** LOCAL GEMS *** abstract (1.0.0) actionmailer (3.0.0.beta, 2.3.5, 2.2.2, 1.3.6) actionpack (3.0.0.beta, 2.3.5, 2.2.2, 1.13.6) actionwebservice (1.2.6) activemerchant (1.4.1) activemodel (3.0.0.beta) activerecord (3.0.0.beta, 2.3.5, 2.2.2, 1.15.6) activerecord-tableless (0.1.0) activeresource (3.0.0.beta, 2.3.5, 2.2.2) activesupport (3.0.0.beta, 2.3.5, 2.2.2, 1.4.4) acts_as_ferret (0.4.3) arel (0.2.pre) authlogic (2.1.3) builder (2.1.2) bundler (0.9.3) calendar_date_select (1.15) capistrano (2.5.2) cgi_multipart_eof_fix (2.5.0) chronic (0.2.3) columnize (0.3.1) compass (0.8.17) daemons (1.0.10) dnssd (0.6.0) erubis (2.6.5) fastercsv (1.5.0) fastthread (1.0.1) fcgi (0.8.7) ferret (0.11.6) flay (1.4.0) flog (2.4.0) gbarcode (0.98.16) gem_plugin (0.2.3) git (1.2.5) haml (2.2.15) haml-edge (2.3.100) highline (1.5.0) hoe (2.4.0) hpricot (0.6.164) i18n (0.3.3) javan-whenever (0.3.7) jeweler (1.4.0) jscruggs-metric_fu (1.1.5) json_pure (1.2.0) libxml-ruby (1.1.2) linecache (0.43) mail (2.1.2) mechanize (0.9.3) memcache-client (1.7.8) mime-types (1.16) mislav-will_paginate (2.3.11) mocha (0.9.7) mojombo-chronic (0.3.0) mongrel (1.1.5) needle (1.3.0) net-scp (1.0.1) net-sftp (2.0.1, 1.1.1) net-ssh (2.0.4, 1.1.4) net-ssh-gateway (1.0.0) nifty-generators (0.3.0) nokogiri (1.4.0) openrain-action_mailer_tls (1.1.3) passenger (2.2.5) polyglot (0.2.9) prawn (0.6.3) prawn-core (0.6.3) prawn-format (0.2.3) prawn-layout (0.3.2) prawn-security (0.1.1) rack (1.1.0, 1.0.1) rack-mount (0.4.5) rack-test (0.5.3) rails (3.0.0.beta, 2.3.5, 2.2.2, 1.2.6) railties (3.0.0.beta) rake (0.8.7, 0.8.3) rake-compiler (0.6.0) RedCloth (4.1.1) reek (1.2.6) relevance-rcov (0.9.2.1) rmagick (2.12.2) roodi (2.1.0) rsl-stringex (1.0.3) rspec (1.2.9) rspec-rails (1.2.9) ruby-debug (0.10.3) ruby-debug-base (0.10.3) ruby-openid (2.1.2) ruby-yadis (0.3.4) ruby2ruby (1.2.4) ruby_parser (2.0.4) rubyforge (2.0.3) rubygems-update (1.3.6, 1.3.5) rubynode (0.1.5) searchlogic (2.3.9) sexp_processor (3.0.3) spree (0.9.4) sqlite3-ruby (1.2.5, 1.2.4) termios (0.9.4) test-unit (2.0.5) text-format (1.0.0) text-hyphen (1.0.0) thor (0.13.0) tlsmail (0.0.1) topfunky-gruff (0.3.5) treetop (1.4.3) tzinfo (0.3.16) xmpp4r (0.4)

    Read the article

  • Rails learn's confusion

    - by Steve
    This is a beginner's rails learning confusion. When I learn rails, from time to time, I feel frustrated on rails' principle "Convention over Configuration". Rails uses heavily on conventions. A lot of them are just naming conventions. If I forget a convention, I will either use the wrong naming and get unexpected result or get things magically done but don't understand how. Sometimes, I think of configuration. At least configuration lists everything clearly and nothing is in fog. In rails, there seems a hidden, dark contract between you and the machine. If you follow the contract, you communicate well. But a beginner usually forgets items listed on the contract and this usually leads to confusion. That's why when I first pick up rails, I feel like it is somehow difficult to learn. Besides, there are many other things that could be new to a learner, such as using git, using plugins from community, using RESTful routing style, using RSpec. All these are new and come together in learning ruby and rails. This definitely adds up difficulties for a beginner. In contrast, if you learn php, it wouldn't be that bad. You can forget many things and focus on learning php itself. You don't need to learn database handling if you know SQL already(in rails, you need to learn a whole new concept migration), you don't have to learn a new decent unit test(in rails, usually they teach RSpec along the way because rails is agile and you should learn test-driven development in the early learning stage), you don't have to learn a new version control(in rails, you will be taught about git anyway), you don't have to use complicated plugins(in rails, they usually use third-party plugins in textbook examples! what the hell? why not teach how to do a simplified similar thing in rails?), you don't have to worry RESTful style. All in all, when I learn php, I learn it quick and soon I start to write things myself. Learning php is similar to learning C/java. It tastes like those traditional languages. When I learn rails, it is more difficult. And I need to learn ruby as well (I believe many of you learn ruby just because of rails). Does anyone have the similar feeling as I have? How do you overcome it and start to master rails? Hints will be welcomed. Thank you.

    Read the article

  • rails log rotation behaves weird (rails version 2.3.5)

    - by robodo
    I'm trying to setup log rotation in rails. I have put this in my environment/development.rb: config.logger = Logger.new("#{RAILS_ROOT}/log/#{ENV['RAILS_ENV']}.log", 1, 5*1048576) 2 files are created :-) but it looks like rails is writing to them randomly and at the same time as well. This creates messy log files :-( what am I missing?

    Read the article

  • Getting to grips with the stack in nasm

    - by MarkPearl
    Today I spent a good part of my day getting to grips with the stack and nasm. After looking at my notes on nasm I think this is one area for the course I am doing they could focus more on… So here are some snippets I have put together that have helped me understand a little bit about the stack… Simplest example of the stack You will probably see examples like the following in circulation… these demonstrate the simplest use of the stack… org 0x100 bits 16 jmp main main: push 42h push 43h push 44h mov ah,2h ;set to display characters pop dx    ;get the first value int 21h   ;and display it pop dx    ;get 2nd value int 21h   ;and display it pop dx    ;get 3rd value int 21h   ;and display it int 20h The output from above code would be… DCB Decoupling code using “call” and “ret” This is great, but it oversimplifies what I want to use the stack for… I do not know if this goes against the grain of assembly programmers or not, but I want to write loosely coupled assembly code – and I want to use the stack as a mechanism for passing values into my decoupled code. In nasm we have the call and return instructions, which provides a mechanism for decoupling code, for example the following could be done… org 0x100 bits 16 jmp main ;---------------------------------------- displayChar: mov ah,2h mov dx,41h int 21h ret ;---------------------------------------- main: call displayChar int 20h   This would output the following to the console A So, it would seem that call and ret allow us to jump to segments of our code and then return back to the calling position – a form of segmenting the code into what we would called in higher order languages “functions” or “methods”. The only issue is, in higher order languages there is a way to pass parameters into the functions and return results. Because of the primitive nature of the call and ret instructions, this does not seem to be obvious. We could of course use the registers to pass values into the subroutine and set values coming out, but the problem with this is we… Have a limited number of registers Are threading our code with tight coupling (it would be hard to migrate methods outside of their intended use in a particular program to another one) With that in mind, I turn to the stack to provide a loosely coupled way of calling subroutines… First attempt with the Stack Initially I thought this would be simple… we could use code that looks as follows to achieve what I want… org 0x100 bits 16 jmp main ;---------------------------------------- displayChar: mov ah,2h pop dx int 21h ret ;---------------------------------------- main: push 41h call displayChar int 20h   However running this application does not give the desired result, I want an ‘A’ to be returned, and I am getting something totally different (you will to). Reading up on the call and ret instructions a discovery is made… they are pushing and popping things onto and off the stack as well… When the call instruction is executed, the current value of IP (the address of the instruction to follow) is pushed onto the stack, when ret is called, the last value on the stack is popped off into the IP register. In effect what the above code is doing is as follows with the stack… push 41h push current value of ip pop current value of ip to dx pop 41h to ip This is not what I want, I need to access the 41h that I pushed onto the stack, but the call value (which is necessary) is putting something in my way. So, what to do? Remember we have other registers we can use as well as a thing called indirect addressing… So, after some reading around, I came up with the following approach using indirect addressing… org 0x100 bits 16 jmp main ;---------------------------------------- displayChar: mov bp,sp mov ah,2h mov dx,[bp+2] int 21h ret ;---------------------------------------- main: push 41h call displayChar int 20h In essence, what I have done here is used a trick with the stack pointer… it goes as follows… Push 41 onto the stack Make the call to the function, which will push the IP register onto the stack and then jump to the displayChar label Move the value in the stack point to the bp register (sp currently points at IP register) Move the at the location of bp minus 2 bytes to dx (this is now the value 41h) display it, execute the ret instruction, which pops the ip value off the stack and goes back to the calling point This approach is still very raw, some further reading around shows that I should be pushing the value of bp onto the stack before replacing it with sp, but it is the starting thread to getting loosely coupled subroutines. Let’s see if you get what the following output would be? org 0x100 bits 16 jmp main ;---------------------------------------- displayChar: mov bp,sp mov ah,2h mov dx,[bp+4] int 21h mov dx,[bp+2] int 21h ret ;---------------------------------------- main: push 41h push 42h call displayChar int 20h The output is… AB Where to from here? If by any luck some assembly programmer comes along and see this code and notices that I have made some fundamental flaw in my logic… I would like to know, so please leave a comment… appreciate any feedback!

    Read the article

  • Problem running Thinking Sphinx with Rails 2.3.5

    - by benoror
    Hi, I just installed Sphinx (distro: archlinux) downloading the source. Then I installed "Thinking Sphinx" plugin for Rails. I followed the official page setup and this Screencast from Ryan Bates, but when I try to index the models it gives me this error: $ rake thinking_sphinx:index (in /home/benoror/Dropbox/Proyectos/cotizahoy) Sphinx cannot be found on your system. You may need to configure the following settings in your config/sphinx.yml file: * bin_path * searchd_binary_name * indexer_binary_name For more information, read the documentation: http://freelancing-god.github.com/ts/en/advanced_config.html Generating Configuration to /home/benoror/Dropbox/Proyectos/cotizahoy/config/development.sphinx.conf sh: indexer: command not found I tried starting the daemon manually (/usr/bin/sphinx-searchd), changing the config/sphinx.yml file: devlopment: searchd_binary_name: sphinx-searchd indexer_binary_name: sphinx-indexer But it shows the same error, any ideas ?

    Read the article

  • Rails Message This User Button

    - by bob
    Hello, I am using this http://github.com/professionalnerd/simple-private-messages plugin in rails and I am on a user page show.html.erb - User and I want to put a button there that, when clicked, goes to the current user's inbox and populates the field call "send to" with the "user" name. How do I send that data along when the button is clicked? <%= link_to image_tag('send_message_button.jpg', :title => 'send #{user} a message', :alt => 'send #{user} a message'), new_user_message_path(current_user), :class=>'messageuser' %> This goes to the current_user's inbox. I want to send the "params[:user_id]" variable along with it so that I can then fill out the "send to" textbox in the inbox page with it. How do I send that params variable along with this button?

    Read the article

  • Ruby on Rails simple_navigation Gem

    - by Paul
    I'm using the simple_navigation gem with RoR 2.3.5 It all seems to work correctly, I followed the info in the RDoc (seen here http://rdoc.info/projects/mexpolk/simple_navigation) However, when I actually render out the simple_navigation menu on my main application.html.erb file it escapes all of the html in it (multiple escapes actually). I end up with junk like this which in a browser ends up with all kinds of disjointed text and ["\ things everywhere. <ul class="simple_navigation" depth="0" id="simple_navigation_default"> ["<li class=\"menu\" drop_down=\"true\" id=\"simple_navigation_default_menus_home\"><a href=\"/home\">Wellcome</a><ul depth=\"1\" id=\"simple_navigation_default_menus_home_menus\"> [\"<li class=\\\"menu\\\" drop_down=\\\"false\\\" id=\\\"simple_navigation_default_menus_home_menus_settings\\\"><a href=\\\"/home/settings\\\">Appliction Settings</a></li>\"] </ul> </li>"] What am I doing wrong? Is there a way to tell Ruby on rails to NOT escape html?

    Read the article

  • Include params/request information in Rails logger?

    - by Dan Hill
    Hi everyone, I'm trying to get some more information into my Rails logs, specifically the requested URI or current params, if available (and I appreciate that they won't always be). However I just don't seem able to. Here's what I've done so far: #config/environments/production.rb config.logger = Logger.new(config.log_path) config.log_level = :error config.logger.level = Logger::ERROR #config/environment.rb class Logger def format_message(level, time, progname, msg) "**********************************************************************\n#{level} #{time.to_s(:db)} -- #{msg}\n" end end So I can customize the message fine, yet I don't seem to be able to access the params/request variables here. Does anyone know if this is possible, and if so how? Or if there's a better way to get this information? (Perhaps even something Redis based?) Thanks loads, Dan

    Read the article

  • Creating a specialised view filtering form in Rails

    - by Schroedinger
    G'day guys, I have a current set of data, and I generate multiple analyses of this data (each analysis into its own active record item called a pricing_interval) using a helper function at the moment. Currently to analyse the set of data, you need a start time(using datetime_select) an integer (using text_field) and a name (using text_field) I would like on submission of the form to be redirected to the index page of my pricing_interval, as the values will be re-generated. Manually generating a range proves that my helper methods work. How would I build a form that on submit would send parameters to a function in the form of (date,integer,name) so that it could immediately begin work whilst redirecting the user to server/pricing_intervals Anything at all would help, I've spent hours over the past few days trying to get the rails form syntax working properly to no avail, a really straightforward guide to what I would implement to get this working would be amazingly appreciated. I've looked through the form guides, as I'm not creating an object, but merely parsing params, there's got to be an easy way to do this, right?

    Read the article

< Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >