Ruby on Rails Wednesday, January 25, 2017


Problem: I have use the net/http code for uploading the '.doc', '.docx', '.pdf' and images files on dropbox. But I getting the issues like:

1.invalid byte sequence in UTF 8
2. Now while the file is uploading but it not uploading the content and even it uploading as a corrupt file.

Below I writing my code to upload the file on dropbox. Please help me.

Code:

uri = URI.parse("https://content.dropboxapi.com/2/files/upload")
          request = Net::HTTP::Post.new(uri)
          request.content_type = "application/octet-stream"
          request["Authorization"] = "Bearer #{$acess_token}"
          request["Dropbox-Api-Arg"] = "{\"path\":\"/Sass-for-Web-Designers.pdf\"}"
          request.body = ""
          request.body << File.open("app/assets/images/categoryImages/Sass-for-Web-Designers.pdf").read
            #request.body << file.content
            #file.close
         

Ruby on Rails Tuesday, January 24, 2017

Bom dia galera!
Paz e bem!

Eu sou novo no framework Ruby on Rails e consegui alguns projetos.
Estou com um projeto de criação de um jornal online de uma comunidade. 

Como eu trabalhava em outras empresas anteriormente, nunca a oportunidade de "cobrar" por um projeto.
Queria pedir ajuda no valor a ser cobrado por este projeto que envolve:
-Planejamento do projeto com o cliente
-Engenharia de Software
-Design de imagem;
-Banco de Dados;
-Hospedagem;
-Manutenção;

Alguém poderia me ajudar em como proceder nessa "cobrança"?

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/86c0a75c-a5ff-409a-9e2f-5c6e2fbfacf7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

Hi All,

In order to support internalization in our application, we are giving an option to the user to select the language. But the problem here is, when one user select one language for example 'Chinese', all other users browser's language also changing to Chinese.

We want something like changing language at client level instead of server level. Is it possible in rails?

Below is the code I am using for setting locale.

    if params[:lang]
      I18n.default_locale = params[:lang]
    end
    I18n.locale = I18n.default_locale

Please let me know if any suggestion on this.

Regards,
Seeni Rafiyullah Khan A,
In Every moment, thank God.

P Please consider the environment before printing this email

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CA%2BfXU%2B0_CoQ5UA3Hk%2BUaPr24OJd%2BRSUiz43KO-sWiF29N6PMLQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.