Search Results

Search found 9 results on 1 pages for 'jyoseph'.

Page 1/1 | 1 

  • DNS - Redirect from old server to new.

    - by jyoseph
    I have a server, (Server A) Windows Server 2003 that I was hosting some sites on. Now they are hosted on a different server (Server B). I recently switched the DNS at godaddy to point to the new nameservers. Is there something I can do on Server A to point all requests to Server A to Server B (basically a redirect from Server A to B)? What type of record would that be? This is while I'm waiting for the DNS changes I made to fully resolve. edit To further clarify. test.com may still be resolving to Server A, I'd like a DNS record on Server A that tells it to go to the new server. Is that possible?

    Read the article

  • Rails - Help with rake task

    - by jyoseph
    I have a rake task I need to run in order to sanitize (remove forward slashes) some data in the database. Here's the task: namespace :db do desc "Remove slashes from old-style URLs" task :substitute_slashes => :environment do puts "Starting" contents = Content.all contents.each do |c| if c.permalink != nil c.permalink.gsub!("/","") c.save! end end puts "Finished" end end Which allows me to run rake db:substitute_slashes --trace If I do puts c.permalink after the gsub! I can see it's setting the attribute properly. However the save! doesn't seem to be working because the data is not changed. Can someone spot what the issue may be? Another thing, I have paperclip installed and this task is triggering [paperclip] Saving attachments. which I would rather avoid.

    Read the article

  • Rails - how to use a plugin from github (how to install, utilize, etc)

    - by jyoseph
    I'm trying to install a couple of different plugins for my rails 3 app. I cd to '/vendor/plugins/', then type git clone the_git_src_url. I see the files in the /vendor/plugins/ directory. However when I try to use any of the tags provided by the plugin I get uninitialized constant ContentsController::HTMLToTextileParser PriceTag and html2textile are the two plugins I'm trying to use. This is what triggers the error above: <%= PriceTag.html_to_textile(@content.desc) %> I'm working in development, I've tried to restart the server. Is there something I'm missing?

    Read the article

  • .htaccess newb - RewriteRule not matching 2nd rule, why?

    - by jyoseph
    I am currently migrating from isapi_rewrite to .htaccess. I'm having some difficulty and I think it's something basic, but I'm not terribly familiar with .htaccess. I have the two rules like so: RewriteRule ^testing/ /test/index.html?test=1 [NC] RewriteRule ^testing/foo-bar/ /test/index.html?test=2 [NC] Yet the second rule never matches. If I go to http://mydomain.com/testing/foo-bar/ then I will only see the first rule. Why is that? And can it be easily fixed? I have many rules (outputted from the database to write the .htaccess file )and ordering them in a particular order isn't really possible.

    Read the article

  • Rails - any fancy ways to handle 404s?

    - by jyoseph
    I have a rails app I built for an old site I converted from another cms (in a non-rails language, hehe). Most of the old pages are mapped to the new pages using routes.rb. But there are still a few 404s. I am a rails newb so I'm asking if there are any advanced ways to handle 404s. For example, if I was programming in my old language I'd do this: Get the URL (script_name) that was being accessed and parse it. Do a lookup in the database for any keywords, ids, etc found in the new URL. If found, redirect to the page (or if multiple records are found, show them all on a results page and let user choose). With rails I'd probably want to do :status = :moved_permanently I'm guessing? If not found, show a 404. Are there any gems/plugins or tutorials you know of that would handle such a thing, if it's even possible. Or can you explain on a high level how that can be done? I don't need a full code sample, just a push in the right direction. PS. It's a simple rails 3 app that uses a single Content model.

    Read the article

  • Rails - default value in text_field but only for new_record?

    - by jyoseph
    On a Content model have an attribute named slug. When creating a new record, I want to use a helper to populate this field, but on an existing record I want to use the value from the database. Currently I have: <%- if @content.new_record? -%> <%= f.text_field :slug, :value => "#{generate_slug(6)}" %> <%- else %> <%= f.text_field :slug %> <%- end %> But that seems a bit verbose. Is this the best way, or is there no other way? (Rails newb just trying to find the "Rails way" on issues I'm unsure of) Edit I should note that the helper is currently in /app/helpers/application_helper.rb

    Read the article

  • Mysql replace() function, help with query (what chars do I escape?)

    - by jyoseph
    I am trying to update an old cms where images were stored in /images/editor/, they are now stored in a bucket on amazon s3. I'm trying to update the database using mysql replace. I've done this in the past with replacing simple words, but now Mysql is reporting an error, I suspect because this is more than a simple word: UPDATE contents SET desc = replace(desc, '/images/editor/', 'http://s3.amazonaws.com/my_bucket/editor/') Do I need to escape the : or slashes? I've tried escaping it with a '\' to no avail. Can someone get me pointed in the right direction? Thanks! Edit Here's the error I am getting, nothing too telling error : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'desc = replace(desc, '/images/editor', 'http://s3.amazonaws.com/app_navigator/ed' at line 1

    Read the article

  • Rails - best way to display code only in production?

    - by jyoseph
    I have a few pieces of code that I would like to display only in production, for instance, the showing of disqus comments. What is the best way to go about doing that? Currently I have: <% if RAILS_ENV.eql?('production') %> disqus code here <% end %> But I am not sure if that's the best method, or is that it? Seems pretty verbose and I would need this in a few different places in the application.

    Read the article

  • jQuery ajax request to php, how to return plain text only

    - by jyoseph
    I am making an ajax request to a php page and I cannot for the life of me get it to just return plain text. $.ajax({ type: 'GET', url: '/shipping/test.php', cache: false, dataType: 'text', data: myData, success: function(data){ console.log(data) } }); in test.php I am including this script to get UPS rates. I am then calling the function with $rate = ups($dest_zip,$service,$weight,$length,$width,$height); I am doing echo $rate; at the bottom of test.php. When viewed in a browser shows the rate, that's great. But when I request the page via ajax I get a bunch of XML. Pastie here: http://pastie.org/1416142 My question is, how do I get it so I can just return the plain text string from the ajax call, where the result data will be a number? Edit, here's what I see in Firebug- Response tab: HTML tab:

    Read the article

1