Ruby on Rails Saturday, December 31, 2016

I get stuck on this page : Control Flow in Ruby ----

When I save and submit code without modifying or adding anything, I get the message :

Oops, try again. Make sure to put an expression after each =!

How to resolve this issue ?

--
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/8da323f4-a746-4af5-bf13-f3ff1a2d8a21%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

Economize no Spotify Premium antes que seja tarde demais.

O Premium normalmente custa R$ 16,90 por mês, mas se você assinar agora, vai poder aproveitar todos os benefícios – como música offline e sem anúncios – durante 3 meses por apenas R$ 1,99.
VÁ DE PREMIUM
Sujeito a restrições, são aplicáveis termos e condições.
Depois, apenas R$ 16,90/mês.
A oferta é válida até 1º de janeiro.

Ruby on Rails Thursday, December 29, 2016

Hi!
I've been struggling with adding metadata to the ActionMailer Preview-header for a while.
What I would ideally like to do is to override the following file somewhere, adding some custom metadata to the header like in the picture attached below:
https://github.com/rails/rails/blob/4-2-stable/railties/lib/rails/templates/rails/mailers/email.html.erb
Alternatively override the mailers controller to render a different template on preview:
https://github.com/rails/rails/blob/4-2-stable/railties/lib/rails/mailers_controller.rb

Is it possible to easily override either of those files without having to change the base gems or similar? Would an extra initializer be needed and if so what should be included?

Hope someone here has some insights!
Best,
David


--
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/e381969a-b7a5-4539-a98e-5bced1edd771%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails Wednesday, December 28, 2016

Buenas Tardes.

Soy nuevo en Ruby On Rails, estoy desarrollando un aplicativo donde los Docentes acceden por medio de correo y clave (configurado con la gema devise), pueden crear estudiantes y crear reportes de los mismos.

 

Estos son los modelos:

 

officer: (Para los usuarios en este caso los Docentes)

 

class Officer < ActiveRecord::Base

  # Include default devise modules. Others available are:

  # :confirmable, :lockable, :timeoutable and :omniauthable

  devise :database_authenticatable, :registerable,

         :recoverable, :rememberable, :trackable, :validatable

  has_many :events

 

  include PermissionsConcern

 

end

 

event (Para los reportes de cada estudiante)

 

class Event < ActiveRecord::Base

  belongs_to :student

  belongs_to :officer

 

  has_many :comments

end

 

student (Para los estuddiantes)

class Student < ActiveRecord::Base

            validates :documento, :colegio, :nombres, :apellidos, :tipodocumento, :genero, :fechanacimiento, :edad, :etnia, :depto, :ciudad, :localidad, :barrio, :grado, :jornada, :discapacidad, :dirresidencia, :telcontacto, :nombreacudiente, :nombremadre, :nombrepadre, presence: true

 

            has_many :events

 

end

 

Siguiendo un tutorial cree la siguiente migración:

 

class AddOfficerIdToEvents < ActiveRecord::Migration

  def change

    add_reference :events, :officer, index: true

    add_foreign_key :events, :officers

  end

end

 

 

 

En el controlador del Reporte puedo crear un reporte para cada Alumno (events_controller):

 

class EventsController < ApplicationController

   

    before_action :authenticate_officer!

 

 

def create

    @student = Student.find(params[:student_id])

    @event = @student.events.create(event_params)

    redirect_to student_path(@student)

    end

 

            private

    def event_params

      params.require(:event).permit(:fechareporte, :fechaevento, :lugar,:descripcion, :officer_id)

    end

 

end

 

 

Sé que en esta línea de código:

 

    @event = @student.events.create(event_params)

 

Se crea y se guarda el reporte, y asocia automáticamente el Alumno. Pero quiero poder mostrar el email del Docente que realizo el reporte, y no sé cómo modificarla para que almacene el officer_id del usuario logueado para saber que Docente realizo el reporte del alumno., he buscando en internet pero no he encontrado como.

 

Ayuda…! Por favor.

Agradezco su amable colaboración.

Gracias.

 

--
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/b8e0877d-6dca-4ca7-afc5-ea31e1193939%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

Buenas Tardes.

Soy nuevo en Ruby On Rails, y me encuentro desarrollando una aplicación en la cual los docentes de un colegio pueden realizar reportes de los alumnos, con restricción de acceso con login y usuario (utilizando devise), los docentes pueden crear estudiantes y realizar los reportes de cada estudiante.
Tengo creados los siguientes modelos:

student: para los alumnos
class Student < ActiveRecord::Base
validates :documento, :colegio, :nombres, :apellidos, :tipodocumento, :genero, :fechanacimiento, :edad, :etnia, :depto, :ciudad, :localidad, :barrio, :grado, :jornada, :discapacidad, :dirresidencia, :telcontacto, :nombreacudiente, :nombremadre, :nombrepadre, presence: true

has_many :events
end

event: para los reportes
class Event < ActiveRecord::Base
  belongs_to :student
  belongs_to :officer

  has_many :comments
end

officer: para los docentes
class Officer < ActiveRecord::Base
  # Include default devise modules. Others available are:
  # :confirmable, :lockable, :timeoutable and :omniauthable
  devise :database_authenticatable, :registerable,
         :recoverable, :rememberable, :trackable, :validatable
  has_many :events

  include PermissionsConcern

end

Siguiendo un tutorial realice esta migración:

class AddOfficerIdToEvents < ActiveRecord::Migration
  def change
    add_reference :events, :officer, index: true
    add_foreign_key :events, :officers
  end
end


En el contralador events_controller, puedo crear el reporte del alumno.

dclass EventsController < ApplicationController
    
    before_action :authenticate_officer!

def create
    @student = Student.find(params[:student_id])
    @event = @student.events.create(event_params)

    redirect_to student_path(@student)
    end

  private
    def event_params
      params.require(:event).permit(:fechareporte, :fechaevento, :lugar, :tipoagresion, :atencionmedica, :conoceagresor, :relacionagresor, :generoagresor, :lesiones, :descripcion, :officer_id)
    end

end 

Pero quiero poder almacenar al mismo tiempo el officer_id, del usuario logueado, para luego poder mostrar el correo del docente que realizo el reporte.
Se que esta linea:

    @event = @student.events.create(event_params)

Se crea y guarda el reporte, ademas asocia automáticamente el alumno. 
Pero no se como modificarla para que también almacene el officer_id del docente que realiza el reporte.

Ayuda...! 
Por favor
Agradezco inmensamente su ayuda.
Gracias 


--
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/910f8bd1-1562-4cea-87df-1ab8ba1d42c1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

I'm having the same issue with video background...not working in rails app... any new solutions for this problem?

On Saturday, February 20, 2016 at 4:40:04 AM UTC-5, Colin Law wrote:
On 20 February 2016 at 09:31, Kranthi Kumar <li...@ruby-forum.com> wrote:
> Colin Law wrote in post #1181533:
>> On 20 February 2016 at 08:53, Kranthi Kumar <li...@ruby-forum.com>
>> wrote:
>>> I include "sprockets_better_errors" gem. Else its working fine.
>> This suggests that gem has not been updated for two years and is not
>> compatible with rails 4.2
>> https://rubygems.org/gems/sprockets_better_errors/versions/0.0.5
>>
>> Colin
>
> Great. Thanks.
>
> But changing "config.assets.compile" to true in production.rb file have
> any affect on my application?

I am not an expert in that area, nor in Heroku.  Have you determined
whether it is a Heroku issue or a production environment issue?  If
not then try running it locally but in production mode and see what
happens.

Colin

--
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/ab0be11d-0ca9-4178-ad19-ae96be314d95%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

I would start by looking at the contents of that file with a text editor, see if there is any XML in it. (Note: you may need to convert the file from a Zip package before you can do that, or use a Mac and BBEdit (which can read "into" Zipped formats like ePub and XSLX and show the plain-text contents therein). The Excel-reading gems that I know of only work on "modern" Excel, the XML-based formats. I've not heard of this XSLB format before, could it mean that it's a binary file? You should know when you look in the package. If it does turn out to be that, you may need to use something like OpenOffice or a Windows server and COM objects to deal with it.

Walter

> On Dec 27, 2016, at 8:19 PM, Rafi A <rafiglitz@gmail.com> wrote:
>
> Hi,
>
> I am using ROO gem on my application for parsing excel files. Now I got an scenario to parse xlsb file but that gem throws me an error. Also I have tried with Creek, spreadsheet gems to parse the xlsb file but no luck.
>
> Is there a way to do that in Rails then please let me know.
>
> Regards,
> Seeni Rafiyullah Khan A,
> 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%2B3f7JMzvhDj%3DxPK6NoE-QvoDnndc4fX9F8mnV8s6Ay--A%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.

--
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/758B7CCB-AC60-4DC4-8C7C-58549F9F5046%40wdstudio.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

Ruby On Rails Interview Question And Answers:

Q.Explain how (almost) everything is an object in Ruby:

  • This is a simple question based on complex concept. Here's your chance to show off your theoretical knowledge and demonstrate that you can have an in depth conversation on class hierarchies, inheritance, methods, encapsulation, polymorphism, and more.

Q.What's your favorite testing tool?

The specific answer here is probably not important in and of itself – What's important is that you can demonstrate familiarity with at least several testing tools, and be able to discuss their individual advantages and weaknesses. Never ventured outside of Rails default testing tools? Take some time to familiarize yourself with tools such as Rspec, FactoryGirl, Capybara, and Cucumber


Q.What are Gems and which are some of your favorites?

  • Short answer: Gems are packaged bits of Ruby code that you can install to extend or add functionality to your app.

Be sure to be able to discuss a list of your favorite gems, why you like them, and any customizations you like to add. This is also a good opportunity to highlight any gems you may have published.


For more information, click the link below.

http://mindmajix.com/ruby-rails-interview-questions/

--
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/f0633757-81d4-45de-bdd4-419c9e25cb0d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails Tuesday, December 27, 2016

Hi,

I am using ROO gem on my application for parsing excel files. Now I got an scenario to parse xlsb file but that gem throws me an error. Also I have tried with Creek, spreadsheet gems to parse the xlsb file but no luck.

Is there a way to do that in Rails then please let me know.

Regards,
Seeni Rafiyullah Khan A,

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%2B3f7JMzvhDj%3DxPK6NoE-QvoDnndc4fX9F8mnV8s6Ay--A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

Deixe as resoluções para o ano novo. Agora é hora de ser Premium. Não perca tempo, aproveite 3 meses por R$ 1,99.
VÁ DE PREMIUM
Sujeito a restrições, são aplicáveis termos e condições.
Depois, apenas R$ 16,90/mês.
A oferta é válida até 1º de janeiro.

Ruby on Rails Monday, December 26, 2016

Which is your development environment? Operation System? The railstutorial.org comes with a link to Cloud 9 (c9.io) In the provided online environment (which is free for personal use) everything can be set up to run Rails, the way you need.

Ad

Op zondag 25 december 2016 14:04:24 UTC+1 schreef Colin Law:
On 25 December 2016 at 12:28, Ad Rienks <ad.r...@gmail.com> wrote:
Sergey,

You created a controller and action, but did you create a view? Without a view you can't see anything. I guess you see the Rails default screen.
Learn Rails through this free tutorial: https://www.railstutorial.org/book. The first few chapters lead you to create a "Hello World" example.

+1 for railstutorial.org (which is free to use online)

Colin
 

--
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/106a2f0e-44ab-43db-8126-ca6418d1677f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails Sunday, December 25, 2016

My best guess since it is an execjs error is you don't have a javascript runtime installed. Be sure you have one of the execjs supported runtimes installed. https://github.com/sstephenson/execjs

On Dec 25, 2016 6:04 AM, "Colin Law" <clanlaw@gmail.com> wrote:
On 25 December 2016 at 12:28, Ad Rienks <ad.rienks@gmail.com> wrote:
Sergey,

You created a controller and action, but did you create a view? Without a view you can't see anything. I guess you see the Rails default screen.
Learn Rails through this free tutorial: https://www.railstutorial.org/book. The first few chapters lead you to create a "Hello World" example.

+1 for railstutorial.org (which is free to use online)

Colin
 

--
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/CAL%3D0gLsvtFHdHY7oj%3DUsxg8oz0v95xwbmoFnm%2B5ES9Fdt9HOrA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

--
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/CAK5aKaanz_PZtgdj40weEqhOUiG7RxVpAxCNdsPbHmGRubACVw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

On 19 December 2016 at 02:28, Walter Lee Davis <waltd@wdstudio.com> wrote:
>
>> On Dec 18, 2016, at 9:06 PM, fugee ohu <fugee279@gmail.com> wrote:
>>
>> On Sunday, December 18, 2016 at 5:27:04 PM UTC-5, Colin Law wrote:
>> On 18 December 2016 at 20:57, fugee ohu <fuge...@gmail.com> wrote:
>> > no i don't have .rvmrc anywhere
>> >
>> > On Sunday, December 18, 2016 at 3:43:59 AM UTC-5, Colin Law wrote:
>> >>
>> >> On 17 December 2016 at 22:32, fugee ohu <fuge...@gmail.com> wrote:
>> >> > configure: error: cannot run C compiled programs. If you meant to cross
>> >> > compile, use--host
>> >>
>> >>
>> >> Have you got a file ~/.rvmrc? If so what is in it?
>> >>
>> >> Paste here the results of rvm info
>>
>> Because you top posted instead of inserting your reply inline you
>> failed, I presume, to notice my second question.
>>
>> Colin
>>
>> So do you have any more ideas?
>
> The second question was "paste here the results of `rvm info`?", so if you run that, maybe you can see some more debugging data.

@Fugee did you resolve this problem?

Colin

--
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/CAL%3D0gLsMfmxWvNYu4ghaEMfcRD-GoNVmmNXSyYaNODfy0Ajk%2BQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

On 25 December 2016 at 12:28, Ad Rienks <ad.rienks@gmail.com> wrote:
Sergey,

You created a controller and action, but did you create a view? Without a view you can't see anything. I guess you see the Rails default screen.
Learn Rails through this free tutorial: https://www.railstutorial.org/book. The first few chapters lead you to create a "Hello World" example.

+1 for railstutorial.org (which is free to use online)

Colin
 

--
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/CAL%3D0gLsvtFHdHY7oj%3DUsxg8oz0v95xwbmoFnm%2B5ES9Fdt9HOrA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

Sergey,

You created a controller and action, but did you create a view? Without a view you can't see anything. I guess you see the Rails default screen.
Learn Rails through this free tutorial: https://www.railstutorial.org/book. The first few chapters lead you to create a "Hello World" example.

Op zaterdag 24 december 2016 09:07:19 UTC+1 schreef Сергей Чевычелов:
Hi everyone!
I'm trying to step through Rails Guide and stuck at step 4.3. I've created my first controller and action, run the server and get the following error message.
Can someone help with this? And i also appreciate if you give me some source to learn Ruby on Rails. Thanks!

--
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/27516902-bbb4-496c-ba65-85f537fd4697%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails Saturday, December 24, 2016



On Wednesday, December 21, 2016 at 10:19:59 PM UTC-5, Hassan Schroeder wrote:
On Wed, Dec 21, 2016 at 6:08 PM, fugee ohu <fuge...@gmail.com> wrote:

> hi thanks, i got it running but even still i can't connect on 9200 and
> netstat shows nothing at 9200; i've tried plugging different values for
> network.host tried everything from localhost to _localhost_ to
> _localhost_IPv4 but still can't connect on 9200

I'm not sure what you're referring to for "different values" but on my
system I can quickly confirm elasticsearch is running by using this:

   curl http://localhost:9200

Do you get a response to that? If not, ES isn't really running :-)

--
Hassan Schroeder ------------------------ hassan.s...@gmail.com
twitter: @hassan
Consulting Availability : Silicon Valley or remote

Hi again Thanks It seems using apt-get install elasticsearch on linux mint 18 gets you a non-working installation so elasticsearch github page says to download the source, unzip and run bin/elasticsearch but then the system complains the package has to be installed into init.d first So I figured I'd just install the deb Surprise, there is no .deb file in the distributions/deb directory Referring to the README.textfile also says to  run bin/elasticsearch So then how shall I install?

--
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/5f6f2d88-bad0-44f8-9597-a92738cce27f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

On Fri, Dec 23, 2016 at 2:30 PM, Сергей Чевычелов
<sergey461219@gmail.com> wrote:

> I'm trying to step through Rails Guide and stuck at step 4.3. I've created my first controller and action, run the server and get the following error message.
> Can someone help with this?

It would help if you

1) provided a link to the "step 4.3" you referenced

2) copy and paste the error message so it can be run through
Google translate or equivalent

3) specify the versions of Ruby and Rails you're using

--
Hassan Schroeder ------------------------ hassan.schroeder@gmail.com
twitter: @hassan
Consulting Availability : Silicon Valley or remote

--
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/CACmC4yDKO9Onhe01Mtt%3DwLY28xg4cnHW_bpQEzv4SkBiswGsvA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.