I'm working on an app where I use SignalR and HTML5 notifications. What I need is to send a notification when the user is not active at that moment or has the browser minimized, something similar to what Facebook does, hence my question. How can I tell when my browser is minimized or the user is not currently in that tab?
Vicente Almea's questions
When generating a scaffold
in Rails it automatically creates the routes and pluralized names for me, example:
rails g scaffold Trabajador nombre apellidos cargo
And Rails generates it as trabajadors
.
My questions are:
- Is there any way to define the name I want when generating the
scaffold
?, any way to specify what I want it to be calledtrabajadores
and nottrabajadors
? - Can it be changed once generated since I have created some this way?
In Code First and Entity Framework tutorials I have found different examples showing the use of the property virtual
in different models.
Example:
public class Student {
public int ID { get; set; }
public string LastName { get; set; }
public string FirstMidName { get; set; }
public DateTime EnrollmentDate { get; set; }
public ICollection<Enrollment> Enrollments { get; set; }
}
Another example:
public class Album {
public virtual int AlbumId { get; set; }
public virtual int GenreId { get; set; }
public virtual int ArtistId { get; set; }
public virtual string Title { get; set; }
public virtual decimal Price { get; set; }
public virtual string AlbumArtUrl { get; set; }
public virtual Genre Genre { get; set; }
public virtual Artist Artist { get; set; }
}
So my question is the following, what is the use of the property virtual
and when to use it?
I need to know how to obtain the Id of the logged in user in an asp.net core project, in asp.net mvc5 I obtained it in the following way:
User.Identity.GetUserId();
but here it doesn't work for me.
We know that ViewData
or ViewBag
are used to pass information from the controller to the view.
Is there any difference between both? For example, in terms of performance and whether the use of one in particular is recommended.
I am using devise
one app rails
for session management, and I wanted to know if I could change the layout
one in which the forms are displayed since it uses application.html.erb
.
I've been looking through the rails documentation where it explains how to define a specific layout in a controller but I don't have access to the controller devise
in my app folder.
In most forms there are selection lists where we have the option of selecting one or several options depending on the relationships that we have defined in our model. In my case I have a collection_select in my rails app to which I want to add search options, just like the jquery chosen but implementing the semantic-ui Search Selection class