Search Results

Search found 8 results on 1 pages for 'jriff'.

Page 1/1 | 1 

  • Charset and POST request

    - by jriff
    Hi All! I have a Rails 2.3.5 application that is working fine with UTF-8 and international characters. Now I have made some integration to a payment gateway where I POST some data, wait a while and get a POST back. The problem is that when I get that post back the international characters are broken. Instead of "sørensen" I get: "sørensen". If I do an iconv -fISO-8859-1 -tUTF8 it gets correctly converted to the former (I do that from a OS X command prompt). I have examined the POST request with logger.info(request.headers.inspect) in my controller and I can see that no charset parameter is given. As far as I can see the POST from the gateway must be UTF8 since one character (ø) gets translated to two (ø). So why does Rails think that the POST is ISO-8859-1? I know that one solution is to simply convert the params-hash with Iconv in the controller but I would like to know what is happening. Thanks in advance. Regards, Jacob

    Read the article

  • Problem with UTF8

    - by jriff
    Hi all! If you are on Mac OS X 10.6, and you are familiar with character encoding AND the terminal please do this: Open a terminal and type the following commands: echo sørensen test.txt iconv -f UTF8 -t ISO-8859-1 test.txt You will see the output: "sørensen". Can somebody explain what is going on?

    Read the article

  • Problem with iconv

    - by jriff
    Hi all! If you are on Mac OS X 10.6, and you are familiar with character encoding AND the terminal please do this: Open a terminal and type the following commands: echo sørensen test.txt iconv -f UTF8 -t ISO-8859-1 test.txt You will see the output: "sørensen". Can somebody explain what is going on?

    Read the article

  • Parent/master project in git

    - by jriff
    I have a project "A" that is a Git repository. I would like to be able to make multiple copies of project A (B and C), and modify them for clients. "A" is the master so sometimes when I do new functionality i would like to be able to pull them into B or C. But some commits should just stay in A and only be used if making a new clone. How do I do that with Git? That is: how to copy A? (Clone?) how to get specific commits into B and C? Please keep in mind that this all happening locally - not on GitHub. I use OS X.

    Read the article

  • Git and cloning

    - by jriff
    Hi all! I have done an app for a client called 'A' (not really). I have found out that it is very cool and that I want to sell it to other clients also. The directory 'A' is a Git repository. I think I have a problem with cloning it. As far as I can see I need to make a copy of the dir 'A' and call it 'Generic_A'. Then delete the dir 'A' and do a "git clone Generic_A A" Then I could start changing the 'Generic_A'-repo with a generic design and all client references removed. But that is kind of the other way around. I should have started doing the generic design and then cloned the repo to change to the client specific design. Can I: make a new branch do all the changes to make the design generic create a patch that reflects the changes between the two remove the client specific branch rename the directory to 'Generic_A' clone the repo to a new dir 'A' apply the patch to get the client specific stuff back And if yes - how do I make the patch and apply it? Regards, Jacob

    Read the article

  • Authlogic's current_user object in models

    - by jriff
    Hi all! I need to know the ID of the current user in a model: def after_save desc, points=nil, nil if answer_index == daily_question.correct_answer_index desc = I18n.t('daily_question.point_log.description.correct') points=daily_question.points else desc = I18n.t('daily_question.point_log.description.incorrect') end current_user.give_points(:description => desc, :points => points ) end But I guess that is not how it is done? Regards, Jacob

    Read the article

  • Advanced find in Rails

    - by jriff
    Hi all I really suck at Rails' finders besides the most obvious. I always resort to SQL when things get more advanced than Model.find(:all, :conditions => ['field>? and field<? and id in (select id from table)', 1,2]) I have this method: def self.get_first_validation_answer(id) a=find_by_sql(" select answers.*, answers_registrations.answer_text from answers_registrations left join answers on answers_registrations.answer_id=answers.id where (answers_registrations.question_id in (select id from questions where validation_question=true)) and (sale_registration_id=#{id}) limit 1 ").first a.answer_text || a.text if a end Can someone create a find method that gets me what I want? Regards, Jacob

    Read the article

  • Parant/master project in git

    - by jriff
    Hi all I have a project "A" that is a Git repo. I would like to be able to make multiple copies of project A (B and C), and modify them for clients. "A" is the master so sometimes when I do new functionality i would like to be able to pull them from B or C. But some commits should just stay in A and never leave :-) How do I do that with Git? That is: how to copy A? (Clone?) how to get specific commits into B and C? Please keep in mind that this all happening locally - not on GitHub. I use OS X. Regards, Jacob.

    Read the article

1